Remove more node_module deps
This commit is contained in:
1 parent
831437c1aa
commit
2fca1d5e74
386 files changed
-26377
No files matched your search
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-57
@@ -1,57 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-65
@@ -1,65 +0,0 @@
|
||||
"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];
|
||||
});
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-44
@@ -1,44 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-47
@@ -1,47 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
"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 };
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-42
@@ -1,42 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-42
@@ -1,42 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-36
@@ -1,36 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
"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);
|
||||
});
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-54
@@ -1,54 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-50
@@ -1,50 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-36
@@ -1,36 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-42
@@ -1,42 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-43
@@ -1,43 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
"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);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-41
@@ -1,41 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @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;
|
||||
Generated
Vendored
-50
@@ -1,50 +0,0 @@
|
||||
"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];
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @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;
|
||||
Generated
Vendored
-46
@@ -1,46 +0,0 @@
|
||||
"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];
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
"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]);
|
||||
}
|
||||
};
|
||||
Generated
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google LLC. All Rights Reserved.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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;
|
||||
Generated
Vendored
-42
@@ -1,42 +0,0 @@
|
||||
"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;
|
||||
}
|
||||
};
|
||||
Loaded 100 of 386 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user