Wrapper for tf.matmul (sparse vs dense).
(x, y, sparse=False)
| 28 | |
| 29 | |
| 30 | def dot(x, y, sparse=False): |
| 31 | """Wrapper for tf.matmul (sparse vs dense).""" |
| 32 | if sparse: |
| 33 | res = tf.sparse_tensor_dense_matmul(x, y) |
| 34 | else: |
| 35 | res = tf.matmul(x, y) |
| 36 | return res |
| 37 | |
| 38 | |
| 39 | class Layer(object): |