Skip to content

Commit 074d10e

Browse files
authored
Implement resizeBilinearBackprop (tensorflow#98)
1 parent 7c1a72c commit 074d10e

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/nodejs_kernel_backend.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,15 @@ export class NodeJSKernelBackend implements KernelBackend {
813813
resizeBilinearBackprop(
814814
dy: Tensor<Rank.R4>, x: Tensor<Rank.R4>,
815815
alignCorners: boolean): Tensor<Rank.R4> {
816-
// https://github.com/tensorflow/tfjs/issues/304
817-
throw new Error('Method not implemented.');
816+
const opAttrs = [
817+
this.createTypeOpAttr('T', x.dtype), {
818+
name: 'align_corners',
819+
type: this.binding.TF_ATTR_BOOL,
820+
value: alignCorners
821+
}
822+
];
823+
return this.executeSingleOutput('ResizeBilinearGrad', opAttrs, [dy, x]) as
824+
Tensor4D;
818825
}
819826

820827
resizeNearestNeighbor(

src/run_tests.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ jasmine_util.setTestEnvFeatures([{BACKEND: 'tensorflow'}]);
3232

3333
const IGNORE_LIST: string[] = [
3434
// See https://github.com/tensorflow/tfjs/issues/161
35-
'depthwiseConv2D', // Requires space_to_batch() for dilation > 1.
36-
'separableConv2d', // Requires space_to_batch() for dilation > 1.
37-
'div', // https://github.com/tensorflow/tfjs/issues/215
38-
'resizeNearestNeighbor', // https://github.com/tensorflow/tfjs/issues/221
39-
'IORouterRegistry', // https://github.com/tensorflow/tfjs/issues/303
40-
'resizeBilinear gradients', // https://github.com/tensorflow/tfjs/issues/304
35+
'depthwiseConv2D', // Requires space_to_batch() for dilation > 1.
36+
'separableConv2d', // Requires space_to_batch() for dilation > 1.
37+
'div', // https://github.com/tensorflow/tfjs/issues/215
38+
'IORouterRegistry', // https://github.com/tensorflow/tfjs/issues/303
4139
// https://github.com/tensorflow/tfjs/issues/279
4240
'browser', 'LocalStorage', 'arrayBufferToBase64String', 'stringByteLength'
4341
];

0 commit comments

Comments
 (0)