Skip to content

Commit

Permalink
[node] Remove deprecated createTypeOpAttr (#3235)
Browse files Browse the repository at this point in the history
BREAKING
remove deprecated function createTypeOpAttr
  • Loading branch information
Kangyi Zhang committed May 11, 2020
1 parent 138f23a commit 46ca8d7
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 141 deletions.
4 changes: 2 additions & 2 deletions tfjs-node/src/kernels/Softmax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import {NamedTensorInfoMap, registerKernel, TensorInfo} from '@tensorflow/tfjs';

import {createTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';
import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';

interface SoftmaxInputs extends NamedTensorInfoMap {
logits: TensorInfo;
Expand All @@ -28,7 +28,7 @@ registerKernel({
backendName: 'tensorflow',
kernelFunc: ({inputs, backend}) => {
const {logits} = inputs as SoftmaxInputs;
const opAttrs = [createTypeOpAttr('T', logits.dtype)];
const opAttrs = [createTensorsTypeOpAttr('T', logits.dtype)];

const nodeBackend = backend as NodeJSKernelBackend;

Expand Down
4 changes: 2 additions & 2 deletions tfjs-node/src/kernels/SquaredDifference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import {KernelConfig, registerKernel} from '@tensorflow/tfjs';
import {createTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';
import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';

export const squaredDifferenceConfig: KernelConfig = {
// TODO import this kernelName from core once exported.
Expand All @@ -25,7 +25,7 @@ export const squaredDifferenceConfig: KernelConfig = {
kernelFunc: ({inputs, backend}) => {
const {a, b} = inputs;

const opAttrs = [createTypeOpAttr('T', a.dtype)];
const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)];
const nodeBackend = backend as NodeJSKernelBackend;

return nodeBackend.executeSingleOutput(
Expand Down
4 changes: 2 additions & 2 deletions tfjs-node/src/kernels/non_max_suppression_v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import {NamedAttrMap, NamedTensorInfoMap, registerKernel, scalar, Tensor1D, Tensor2D, TensorInfo} from '@tensorflow/tfjs';

import {createTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';
import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';

interface NonMaxSuppressionWithScoreInputs extends NamedTensorInfoMap {
boxes: TensorInfo;
Expand All @@ -43,7 +43,7 @@ registerKernel({
const iouThresholdTensor = scalar(iouThreshold);
const scoreThresholdTensor = scalar(scoreThreshold);
const softNmsSigmaTensor = scalar(softNmsSigma);
const opAttrs = [createTypeOpAttr('T', boxes.dtype)];
const opAttrs = [createTensorsTypeOpAttr('T', boxes.dtype)];

const nodeBackend = backend as NodeJSKernelBackend;

Expand Down
Loading

0 comments on commit 46ca8d7

Please sign in to comment.