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

Function executeOp

tfjs-converter/src/operations/executors/basic_math_executor.ts:29–180  ·  view source on GitHub ↗
(node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext,
     ops = tfOps)

Source from the content-addressed store, hash-verified

27
28export const executeOp: InternalOpExecutor =
29 (node: Node, tensorMap: NamedTensorsMap, context: ExecutionContext,
30 ops = tfOps): Tensor[] => {
31 switch (node.op) {
32 case 'Abs':
33 case 'ComplexAbs':
34 return [ops.abs(
35 getParamValue('x', node, tensorMap, context) as Tensor)];
36 case 'Acos':
37 return [ops.acos(
38 getParamValue('x', node, tensorMap, context) as Tensor)];
39 case 'Acosh':
40 return [ops.acosh(
41 getParamValue('x', node, tensorMap, context) as Tensor)];
42 case 'Asin':
43 return [ops.asin(
44 getParamValue('x', node, tensorMap, context) as Tensor)];
45 case 'Asinh':
46 return [ops.asinh(
47 getParamValue('x', node, tensorMap, context) as Tensor)];
48 case 'Atan':
49 return [ops.atan(
50 getParamValue('x', node, tensorMap, context) as Tensor)];
51 case 'Atan2':
52 return [ops.atan2(
53 getParamValue('x', node, tensorMap, context) as Tensor,
54 getParamValue('y', node, tensorMap, context) as Tensor)];
55 case 'Atanh':
56 return [ops.atanh(
57 getParamValue('x', node, tensorMap, context) as Tensor)];
58 case 'Ceil':
59 return [ops.ceil(
60 getParamValue('x', node, tensorMap, context) as Tensor)];
61 case 'Complex':
62 return [ops.complex(
63 getParamValue('real', node, tensorMap, context) as Tensor,
64 getParamValue('imag', node, tensorMap, context) as Tensor)];
65 case 'Cos':
66 return [ops.cos(
67 getParamValue('x', node, tensorMap, context) as Tensor)];
68 case 'Cosh':
69 return [ops.cosh(
70 getParamValue('x', node, tensorMap, context) as Tensor)];
71 case 'Elu':
72 return [ops.elu(
73 getParamValue('x', node, tensorMap, context) as Tensor)];
74 case 'Erf':
75 return [ops.erf(
76 getParamValue('x', node, tensorMap, context) as Tensor)];
77 case 'Exp':
78 return [ops.exp(
79 getParamValue('x', node, tensorMap, context) as Tensor)];
80 case 'Expm1': {
81 return [ops.expm1(
82 getParamValue('x', node, tensorMap, context) as Tensor)];
83 }
84 case 'Floor':
85 return [ops.floor(
86 getParamValue('x', node, tensorMap, context) as Tensor)];

Callers 1

Calls 15

getParamValueFunction · 0.90
getTensorFunction · 0.90
acosMethod · 0.80
acoshMethod · 0.80
asinMethod · 0.80
asinhMethod · 0.80
atanMethod · 0.80
atan2Method · 0.80
atanhMethod · 0.80
ceilMethod · 0.80
cosMethod · 0.80
coshMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…