Torben. - 5 months ago 45

Python Question

I'm trying to understand the structure and the coding of tensorflow. While going through this tutorial "https://danijar.com/introduction-to-recurrent-networks-in-tensorflow/" I have searched for the code that is used in the functions.

For example the line

`cell = GRUCell(num_neurons) # Or LSTMCell(num_neurons)`

uses the function GRUCell, which I can find in the file "rnn_cell.py" in the tensorflow repository. Furthermore the GRUCell is wrapped by a function called "tf.nn.dynamic_rnn" as follows:

`output, state = tf.nn.dynamic_rnn(cell, data, dtype=tf.float32)`

Unfortunately I am not able to find the code for this function. Where do I find it? Everything I find is this documentation:

https://github.com/tensorflow/tensorflow/blob/eb56a8af24695bf8258addf28b0c53fbabff72e6/tensorflow/g3doc/api_docs/python/functions_and_classes/shard8/tf.nn.dynamic_rnn.md

Thanks for helping!

Answer

You can find it and other related operations here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn.py