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

Function getKernelNamesForConfig

tfjs/tools/custom_module/cli.ts:118–134  ·  view source on GitHub ↗
(config: CustomTFJSBundleConfig)

Source from the content-addressed store, hash-verified

116}
117
118function getKernelNamesForConfig(config: CustomTFJSBundleConfig) {
119 // Later on this will do a union of kernels from entries, models and
120 // kernels, (and kernels used by the converter itself) Currently we only
121 // support directly listing kernels. remember that this also needs to handle
122 // kernels used by gradients if forwardModeOnly is false.
123
124 // Ops in core that are implemented as custom ops may appear in tf.profile
125 // they will have __op as a suffix. These do not have corresponding backend
126 // kernels so we need to filter them out.
127 function isNotCustomOp(kernelName: string) {
128 // opSuffix value is defined in tfjs-core/src/operation.ts
129 // duplicating it here to avoid an export.
130 return !kernelName.endsWith(OP_SCOPE_SUFFIX);
131 }
132
133 return config.kernels.filter(isNotCustomOp);
134}
135
136const customConfig = validateArgs();
137const kernelsToInclude = getKernelNamesForConfig(customConfig);

Callers 1

cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…