Mustafa Gönen
Mustafa Gönen

Reputation: 99

Where can I find exactly how Tensorflow does matrix multiplication?

For example, I want to do a matrix multiplication, and in doing so, I use the tf.matmul operation inside the tensorflow. And, i want to optimize matrix mulptiplication in tf. However, I cannot reach where the matrix Multiplication is made exactly in tf_matmul. Is there any people who can help me to do this ?

Upvotes: 1

Views: 172

Answers (1)

IanQ
IanQ

Reputation: 2109

We need to do some code tracing to figure out what is being called and what is happening

1) tensorflow.python.ops.math_ops called via tf.matmul

2) tf.matmul returns either a sparse_matmul (which calls gen_math_ops.sparse_matmul) or gen_math_ops.batch_mat_mul

3) The gen_math_ops script is automatically generated but the underlying code is math_ops.cc

All the best!

Upvotes: 1

Related Questions