MCPcopy Create free account
hub / github.com/tensorflow/tfjs / getOpsForConfig

Function getOpsForConfig

tfjs/tools/custom_module/model_parser.ts:25–42  ·  view source on GitHub ↗
(
    // tslint:disable-next-line: no-any
    config: CustomTFJSBundleConfig, kernelToOps: any)

Source from the content-addressed store, hash-verified

23import {bail} from './util';
24
25export function getOpsForConfig(
26 // tslint:disable-next-line: no-any
27 config: CustomTFJSBundleConfig, kernelToOps: any) {
28 // This will return a list of ops used by the model.json(s) passed in.
29 const results: Set<string> = new Set();
30 let modelJson;
31 for (const modelJsonPath of config.models) {
32 try {
33 modelJson = JSON.parse(fs.readFileSync(modelJsonPath, 'utf-8'));
34 } catch (e) {
35 bail(`Error loading JSON file ${modelJsonPath}`);
36 }
37
38 const ops = getOps(modelJson, kernelToOps);
39 ops.forEach((op: string) => results.add(op));
40 }
41 return Array.from(results);
42}
43
44export function getOps(
45 // tslint:disable-next-line: no-any

Callers 1

Calls 3

bailFunction · 0.90
getOpsFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…