MCPcopy Create free account
hub / github.com/conflow-dev/ConFlow / e_matmul

Function e_matmul

model_demo/DeepCrossing/operators.py:69–80  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

67
68@tf.custom_gradient
69def e_matmul(x, y):
70 z = tf.matmul(x, y)
71 def grad(dz):
72 index = [1,2,0,3,1,4]
73 dx = tf.matmul(dz, tf.transpose(y))
74 real_batch = 32
75 dy = tf.zeros_like(y)
76 for i in index:
77 for j in index:
78 dy += tf.matmul(tf.transpose(x[i * real_batch : (i + 1) * real_batch]),dz[j * real_batch : (j + 1) * real_batch])
79 return dx, dy
80 return z, grad
81
82
83def create_enclave():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected