MCPcopy
hub / github.com/tensorflow/tfjs / get

Function get

tfjs-layers/src/metrics.ts:149–157  ·  view source on GitHub ↗
(identifier: string|LossOrMetricFn)

Source from the content-addressed store, hash-verified

147};
148
149export function get(identifier: string|LossOrMetricFn): LossOrMetricFn {
150 if (typeof identifier === 'string' && identifier in metricsMap) {
151 return metricsMap[identifier];
152 } else if (typeof identifier !== 'string' && identifier != null) {
153 return identifier;
154 } else {
155 throw new ValueError(`Unknown metric ${identifier}`);
156 }
157}
158
159/**
160 * Get the shortcut function name.

Callers 1

metrics_test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected