function fromMemory(modelArtifacts, weightSpecs, weightData, trainingConfig) {
	  if (arguments.length === 1) {
	    var isModelArtifacts = modelArtifacts.modelTopology != null || modelArtifacts.weightSpecs != null;

	    if (isModelArtifacts) {
	      return new PassthroughLoader(modelArtifacts);
	    } else {
	      // Legacy support: with only modelTopology.
	      // TODO(cais): Remove this deprecated API.
	      console.warn('Please call tf.io.fromMemory() with only one argument. ' + 'The argument should be of type ModelArtifacts. ' + 'The multi-argument signature of tf.io.fromMemory() has been ' + 'deprecated and will be removed in a future release.');
	      return new PassthroughLoader({
	        modelTopology: modelArtifacts
	      });
	    }
	  } else {
	    // Legacy support.
	    // TODO(cais): Remove this deprecated API.
	    console.warn('Please call tf.io.fromMemory() with only one argument. ' + 'The argument should be of type ModelArtifacts. ' + 'The multi-argument signature of tf.io.fromMemory() has been ' + 'deprecated and will be removed in a future release.');
	    return new PassthroughLoader({
	      modelTopology: modelArtifacts,
	      weightSpecs: weightSpecs,
	      weightData: weightData,
	      trainingConfig: trainingConfig
	    });
	  }
	}
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.

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

@param modelArtifacts a object containing model topology (i.e., parsed from
  the JSON format).
@param weightSpecs An array of `WeightsManifestEntry` objects describing the
  names, shapes, types, and quantization of the weight data.
@param weightData A single `ArrayBuffer` containing the weight data,
  concatenated in the order described by the weightSpecs.
@param trainingConfig Model training configuration. Optional.

@returns A passthrough `IOHandler` that simply loads the provided data.