MCPcopy Create free account
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-react-native/src/async_storage_io.ts:67–80  ·  view source on GitHub ↗
(protected readonly modelPath: string)

Source from the content-addressed store, hash-verified

65 protected asyncStorage: AsyncStorageStatic;
66
67 constructor(protected readonly modelPath: string) {
68 if (modelPath == null || !modelPath) {
69 throw new Error('modelPath must not be null, undefined or empty.');
70 }
71 this.keys = getModelKeys(this.modelPath);
72
73 // We import this dynamically because it binds to a native library that
74 // needs to be installed by the user if they use this handler. We don't
75 // want users who are not using AsyncStorage to have to install this
76 // library.
77 this.asyncStorage =
78 // tslint:disable-next-line:no-require-imports
79 require('@react-native-async-storage/async-storage').default;
80 }
81
82 /**
83 * Save model artifacts to AsyncStorage

Callers

nothing calls this directly

Calls 1

getModelKeysFunction · 0.70

Tested by

no test coverage detected