Last active
June 1, 2018 21:53
-
-
Save BrianPugh/c81cb9706df19d59ef0c3717356cd1ad to your computer and use it in GitHub Desktop.
Useful Tensorflow one-liners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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