(
// tslint:disable-next-line: no-any
config: CustomTFJSBundleConfig, kernelToOps: any)
| 23 | import {bail} from './util'; |
| 24 | |
| 25 | export 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 | |
| 44 | export function getOps( |
| 45 | // tslint:disable-next-line: no-any |
no test coverage detected
searching dependent graphs…