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

Method constructor

tfjs-node/src/io/file_system.ts:68–78  ·  view source on GitHub ↗

* Constructor of the NodeFileSystem IOHandler. * @param path A single path or an Array of paths. * For saving: expects a single path pointing to an existing or nonexistent * directory. If the directory does not exist, it will be * created. * For loading: * - If the

(path: string|string[])

Source from the content-addressed store, hash-verified

66 * JSON file.
67 */
68 constructor(path: string|string[]) {
69 if (Array.isArray(path)) {
70 tf.util.assert(
71 path.length === 2,
72 () => 'file paths must have a length of 2, ' +
73 `(actual length is ${path.length}).`);
74 this.path = path.map(p => resolve(p));
75 } else {
76 this.path = resolve(path);
77 }
78 }
79
80 async save(modelArtifacts: tf.io.ModelArtifacts): Promise<tf.io.SaveResult> {
81 if (Array.isArray(this.path)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected