* 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[])
| 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)) { |
nothing calls this directly
no outgoing calls
no test coverage detected