Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinscott committed Nov 21, 2023
1 parent d7bbf8c commit c1ae537
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/shared/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tf from '@tensorflow/tfjs-core';
import { Tensor, Tensor3D, Tensor4D, } from '@tensorflow/tfjs-core';
import { DynamicShape4D, FixedShape4D, IsTensor, MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE, ModelDefinition, ModelType, Shape4D } from './types';
import { DynamicShape4D, FixedShape4D, IsTensor, ModelType, Shape4D } from './types';

export const isShape4D = (shape?: unknown): shape is Shape4D => {
if (!Boolean(shape) || !Array.isArray(shape) || shape.length !== 4) {
Expand Down Expand Up @@ -29,14 +29,6 @@ export const isTensor = (input: unknown): input is tf.Tensor => input instanceof
export const isString = (el: unknown): el is string => typeof el === 'string';

export const isValidModelType = (modelType: unknown): modelType is ModelType => typeof modelType === 'string' && ['layers', 'graph',].includes(modelType);
export class ModelDefinitionValidationError extends Error {
type: MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE;

constructor(type: MODEL_DEFINITION_VALIDATION_CHECK_ERROR_TYPE) {
super(type);
this.type = type;
}
}

export const hasValidChannels = (tensor: tf.Tensor): boolean => tensor.shape.slice(-1)[0] === 3;

Expand Down

0 comments on commit c1ae537

Please sign in to comment.