(config: CustomTFJSBundleConfig)
| 116 | } |
| 117 | |
| 118 | function 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 | |
| 136 | const customConfig = validateArgs(); |
| 137 | const kernelsToInclude = getKernelNamesForConfig(customConfig); |
no outgoing calls
no test coverage detected
searching dependent graphs…