From 80f4dc6dcf048667d4ebfb07ccdc638de9678884 Mon Sep 17 00:00:00 2001 From: David Don Young Kim Date: Fri, 23 Sep 2022 15:46:42 -0700 Subject: [PATCH] refactoring in computeOutputShape for image resizing layer --- tfjs-layers/src/layers/preprocessing/image_resizing.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tfjs-layers/src/layers/preprocessing/image_resizing.ts b/tfjs-layers/src/layers/preprocessing/image_resizing.ts index 8d9ef9035b5..feacf5d2f6b 100644 --- a/tfjs-layers/src/layers/preprocessing/image_resizing.ts +++ b/tfjs-layers/src/layers/preprocessing/image_resizing.ts @@ -68,7 +68,8 @@ export class Resizing extends Layer { computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] { inputShape = getExactlyOneShape(inputShape); - const numChannels = inputShape.slice(inputShape.length - 1)[0]; + // inputShape.slice(inputShape.length - 1)[0]; + const numChannels = inputShape.slice()[2]; const outputShape = []; outputShape.push(this.height); outputShape.push(this.width);