MCPcopy Index your code
hub / github.com/tensorflow/tfjs / getModelJSONForModelArtifacts

Function getModelJSONForModelArtifacts

tfjs-core/src/io/io_utils.ts:495–520  ·  view source on GitHub ↗
(
    artifacts: ModelArtifacts, manifest: WeightsManifestConfig)

Source from the content-addressed store, hash-verified

493 * artifacts and weights
494 */
495export function getModelJSONForModelArtifacts(
496 artifacts: ModelArtifacts, manifest: WeightsManifestConfig): ModelJSON {
497 const result: ModelJSON = {
498 modelTopology: artifacts.modelTopology,
499 format: artifacts.format,
500 generatedBy: artifacts.generatedBy,
501 convertedBy: artifacts.convertedBy,
502 weightsManifest: manifest
503 };
504 if (artifacts.signature != null) {
505 result.signature = artifacts.signature;
506 }
507 if (artifacts.userDefinedMetadata != null) {
508 result.userDefinedMetadata = artifacts.userDefinedMetadata;
509 }
510 if (artifacts.modelInitializer != null) {
511 result.modelInitializer = artifacts.modelInitializer;
512 }
513 if (artifacts.initializerSignature != null) {
514 result.initializerSignature = artifacts.initializerSignature;
515 }
516 if (artifacts.trainingConfig != null) {
517 result.trainingConfig = artifacts.trainingConfig;
518 }
519 return result;
520}
521
522/**
523 * Create `ModelArtifacts` from a JSON file and weights.

Callers 2

saveMethod · 0.90
saveMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…