title: Getting Cuda code from Tensorflow or Keras
body: <p>I have a code in Keras (or its TF version). I want to have a CUDA code which is equivalence to it. Is there a way to get it?</p>
  
  <p>I know that from Keras I can look at the basic graph topology using the following code:</p>
  
  <pre><code># LSTM for sequence classification in the IMDB dataset
  import numpy
  from keras.datasets import imdb
  from keras.models import Sequential
  from keras.layers import Dense
  from keras.layers import LSTM
  from keras.layers.embeddings import Embedding
  from keras import backend as K
  from keras.preprocessing import sequence
  # fix random seed for reproducibility
  numpy.random.seed(7)
  # load the dataset but only keep the top n words, zero the rest
  top_words = 5000
  max_review_length = 500
  # create the model
  embedding_vecor_length = 32
  model = Sequential()
  model.add(Embedding(top_words, embedding_vecor_length, input_length=max_review_length))
  model.add(LSTM(100))
  model.add(Dense(1, activation='sigmoid'))
  model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
  
  g = K.get_session().graph
  # GIVES THE GRAPH TOPOLOGY!:
  graph_def = g.as_graph_def()
  </code></pre>
  
  <p>Is there a way to have the .cc file that represent this code?</p>
  
  <p>Thanks!</p>