Skip to content

Instantly share code, notes, and snippets.

@BrianPugh
Last active June 1, 2018 21:53
Show Gist options
  • Save BrianPugh/c81cb9706df19d59ef0c3717356cd1ad to your computer and use it in GitHub Desktop.
Save BrianPugh/c81cb9706df19d59ef0c3717356cd1ad to your computer and use it in GitHub Desktop.
Useful Tensorflow one-liners
# Name of all Variables in Graph
# Source: https://stackoverflow.com/questions/36883949/in-tensorflow-get-the-names-of-all-the-tensors-in-a-graph
from pprint import pprint
pprint([n.name for n in tf.get_default_graph().as_graph_def().node if "Variable" in n.op ])
# check for substring in list of strings
print( "\n".join(s for s in list if sub in s) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment