From e76a1e4386b5b28a74f04533cfbd214ee2726884 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Fri, 14 Oct 2022 10:39:51 -0700 Subject: [PATCH] Fix incorrect import path in center crop layer `center_crop.ts` imported some dependencies from `@tensorflow/tfjs-core/ops/...`. This works in Bazel (not completely sure why), but is not standard and should be avoided. --- tfjs-layers/src/layers/preprocessing/center_crop.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tfjs-layers/src/layers/preprocessing/center_crop.ts b/tfjs-layers/src/layers/preprocessing/center_crop.ts index f41659dba5c..79de0d995e6 100644 --- a/tfjs-layers/src/layers/preprocessing/center_crop.ts +++ b/tfjs-layers/src/layers/preprocessing/center_crop.ts @@ -8,15 +8,15 @@ * ============================================================================= */ -import {serialization,DataType,unstack,stack,tensor,Tensor,Tensor1D,Tensor2D, Tensor3D, Tensor4D, tidy, range} from '@tensorflow/tfjs-core'; +import {serialization,DataType,unstack,stack,tensor,Tensor,Tensor1D,Tensor2D, Tensor3D, Tensor4D, tidy, range, image} from '@tensorflow/tfjs-core'; import {getExactlyOneShape, getExactlyOneTensor} from '../../utils/types_utils'; -import {resizeBilinear} from '@tensorflow/tfjs-core/ops/image/resize_bilinear'; -import {cropAndResize} from '@tensorflow/tfjs-core/ops/image/crop_and_resize'; import {LayerArgs, Layer} from '../../engine/topology'; import {Kwargs} from '../../types'; import {Shape} from '../../keras_format/common'; import * as K from '../../backend/tfjs_backend'; +const {resizeBilinear, cropAndResize} = image; + export declare interface CenterCropArgs extends LayerArgs{ height: number; width: number;