Skip to content

Instantly share code, notes, and snippets.

@jamesr66a
Created March 10, 2019 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesr66a/21fc5f0d407ac80d779d661560467710 to your computer and use it in GitHub Desktop.
Save jamesr66a/21fc5f0d407ac80d779d661560467710 to your computer and use it in GitHub Desktop.
from __future__ import print_function
def tf__RNN(x, weights, biases):
try:
with ag__.function_scope('RNN'):
do_return = False
retval_ = None
x = ag__.converted_call('unstack', tf, ag__.ConversionOptions(recursive=True, verbose=0, strip_decorators=(ag__.convert, ag__.do_not_convert, ag__.converted_call), force_conversion=False, optional_features=ag__.Feature.ALL, internal_convert_user_code=True), (x, timesteps, 1), {})
lstm_cell = ag__.converted_call(LSTMCell, None, ag__.ConversionOptions(recursive=True, verbose=0, strip_decorators=(ag__.convert, ag__.do_not_convert, ag__.converted_call), force_conversion=False, optional_features=ag__.Feature.ALL, internal_convert_user_code=True), (num_hidden,), {'forget_bias': 1.0})
outputs, states = ag__.converted_call(static_rnn, None, ag__.ConversionOptions(recursive=True, verbose=0, strip_decorators=(ag__.convert, ag__.do_not_convert, ag__.converted_call), force_conversion=False, optional_features=ag__.Feature.ALL, internal_convert_user_code=True), (lstm_cell, x), {'dtype': tf.float32})
do_return = True
retval_ = ag__.converted_call('matmul', tf, ag__.ConversionOptions(recursive=True, verbose=0, strip_decorators=(ag__.convert, ag__.do_not_convert, ag__.converted_call), force_conversion=False, optional_features=ag__.Feature.ALL, internal_convert_user_code=True), (ag__.get_item(outputs, ag__.u_sub(1), opts=ag__.GetItemOpts(element_dtype=None)), ag__.get_item(weights, 'out', opts=ag__.GetItemOpts(element_dtype=None))), {}) + ag__.get_item(biases, 'out', opts=ag__.GetItemOpts(element_dtype=None))
return retval_
except:
ag__.rewrite_graph_construction_error(ag_source_map__)
tf__RNN.autograph_info__ = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment