Skip to content

Commit

Permalink
Deprecate core from tensor-utils (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinscott authored Oct 8, 2023
1 parent 5ff8373 commit fb9b775
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/upscalerjs/src/shared/tensor-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {
import {
isValidRange,
isFixedShape4D,
} from '@upscalerjs/core';
} from '../../../shared/src/constants';
import {
GET_INVALID_SHAPED_TENSOR,
GET_UNDEFINED_TENSORS_ERROR,
} from './errors-and-warnings.js';

import type * as core from '@upscalerjs/core';
import type * as sharedConstants from '../../../shared/src/constants';

vi.mock('@tensorflow/tfjs-node', async () => {
const tf = await vi.importActual('@tensorflow/tfjs-node') as typeof tfn;
Expand All @@ -32,8 +32,8 @@ vi.mock('@tensorflow/tfjs-node', async () => {
};
});

vi.mock('@upscalerjs/core', async () => {
const { isTensor, isValidRange, isFixedShape4D, ...rest } = await vi.importActual('@upscalerjs/core') as typeof core;
vi.mock('../../../shared/src/constants', async () => {
const { isTensor, isValidRange, isFixedShape4D, ...rest } = await vi.importActual('../../../shared/src/constants') as typeof sharedConstants;
return {
...rest,
isTensor: vi.fn().mockImplementation(isTensor),
Expand Down
12 changes: 7 additions & 5 deletions packages/upscalerjs/src/shared/tensor-utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Tensor, Tensor3D, Tensor4D, } from '@tensorflow/tfjs-core';
import {
Range,
Shape4D,
import {
isValidRange,
isThreeDimensionalTensor,
isFourDimensionalTensor,
isFixedShape4D,
FixedShape4D,
isTensor,
} from '../../../shared/src/constants';
import type {
Range,
Shape4D,
FixedShape4D,
TF,
} from '@upscalerjs/core';
} from '../../../shared/src/types';
import {
GET_INVALID_SHAPED_TENSOR,
GET_UNDEFINED_TENSORS_ERROR,
Expand Down

0 comments on commit fb9b775

Please sign in to comment.