MCPcopy Index your code
hub / github.com/apache/tvm / createArtifactCache

Function createArtifactCache

web/src/artifact_cache.ts:814–840  ·  view source on GitHub ↗
(
  scope: string,
  options: TensorCacheAccessOptions = {},
)

Source from the content-addressed store, hash-verified

812}
813
814export function createArtifactCache(
815 scope: string,
816 options: TensorCacheAccessOptions = {},
817): ArtifactCacheTemplate {
818 if (options.artifactCache !== undefined) {
819 return options.artifactCache;
820 }
821 const cacheType = normalizeCacheType(options.cacheType);
822 if (cacheType === "indexeddb") {
823 return new ArtifactIndexedDBCache(scope);
824 }
825 if (cacheType === "cross-origin") {
826 if (CrossOriginStorage.isAvailable()) {
827 return new ArtifactCrossOriginStorageCache(scope);
828 }
829 if (!crossOriginFallbackWarningLogged) {
830 console.warn(
831 "Cross-origin storage backend is unavailable; falling back to ArtifactCache.",
832 );
833 crossOriginFallbackWarningLogged = true;
834 }
835 }
836 if (cacheType === "opfs") {
837 return new ArtifactOPFSCache(scope, options.opfsAccessMode);
838 }
839 return new ArtifactCache(scope);
840}
841
842
843/**

Callers 3

fetchTensorCacheMethod · 0.90
hasTensorInCacheFunction · 0.85
deleteTensorCacheFunction · 0.85

Calls 2

normalizeCacheTypeFunction · 0.85
isAvailableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…