• Creates an IOHandler that loads model artifacts from memory.

    When used in conjunction with tf.loadLayersModel, an instance of tf.LayersModel (Keras-style) can be constructed from the loaded artifacts.

    const model = await tf.loadLayersModel(tf.io.fromMemory(
    modelTopology, weightSpecs, weightData));

    Parameters

    • modelArtifacts: {} | ModelArtifacts

      a object containing model topology (i.e., parsed from the JSON format).

    • OptionalweightSpecs: WeightsManifestEntry[]

      An array of WeightsManifestEntry objects describing the names, shapes, types, and quantization of the weight data. Optional.

    • OptionalweightData: WeightData

      A single ArrayBuffer containing the weight data, concatenated in the order described by the weightSpecs. Optional.

    • OptionaltrainingConfig: TrainingConfig

      Model training configuration. Optional.

    Returns IOHandlerSync

    A passthrough IOHandlerSync that simply loads the provided data.