Wrapper for tf.matmul (sparse vs dense).
(x, y, sparse=False)
| 69 | |
| 70 | |
| 71 | def dot(x, y, sparse=False): |
| 72 | """Wrapper for tf.matmul (sparse vs dense).""" |
| 73 | if sparse: |
| 74 | res = tf.sparse_tensor_dense_matmul(x, y) |
| 75 | else: |
| 76 | res = tf.matmul(x, y) |
| 77 | return res |
| 78 | |
| 79 | |
| 80 | class Layer(object): |