(x, y)
| 66 | |
| 67 | @tf.custom_gradient |
| 68 | def e_matmul(x, y): |
| 69 | z = tf.matmul(x, y) |
| 70 | def grad(dz): |
| 71 | index = [1,2,0,3,1,4] |
| 72 | dx = tf.matmul(dz, tf.transpose(y)) |
| 73 | real_batch = 32 |
| 74 | dy = tf.zeros_like(y) |
| 75 | for i in index: |
| 76 | for j in index: |
| 77 | dy += tf.matmul(tf.transpose(x[i * real_batch : (i + 1) * real_batch]),dz[j * real_batch : (j + 1) * real_batch]) |
| 78 | return dx, dy |
| 79 | return z, grad |
| 80 | |
| 81 | def create_enclave(): |
| 82 | sgx_lib = cdll.LoadLibrary(os.path.join(current_path + "/sgx_tf_ops/", "sgx.so")) |
nothing calls this directly
no outgoing calls
no test coverage detected