Skip to content

Instantly share code, notes, and snippets.

@kevinrobinson
Last active December 18, 2015 02:41
Show Gist options
  • Select an option

  • Save kevinrobinson/fd82b76408397b6d0ac9 to your computer and use it in GitHub Desktop.

Select an option

Save kevinrobinson/fd82b76408397b6d0ac9 to your computer and use it in GitHub Desktop.
>>> import tensorflow as tf
>>> a = tf.Variable(tf.zeros([784, 10], name='a')
>>> print str(tf.get_default_graph().as_graph_def())
node {
name: "a"
op: "Const"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "value"
value {
tensor {
dtype: DT_FLOAT
tensor_shape {
dim {
size: 784
}
dim {
size: 10
}
}
float_val: 0.0
}
}
}
}
node {
name: "Variable"
op: "Variable"
attr {
key: "container"
value {
s: ""
}
}
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "shape"
value {
shape {
dim {
size: 784
}
dim {
size: 10
}
}
}
}
attr {
key: "shared_name"
value {
s: ""
}
}
}
node {
name: "Variable/Assign"
op: "Assign"
input: "Variable"
input: "a"
attr {
key: "T"
value {
type: DT_FLOAT
}
}
attr {
key: "use_locking"
value {
b: true
}
}
attr {
key: "validate_shape"
value {
b: true
}
}
}
node {
name: "Variable/read"
op: "Identity"
input: "Variable"
attr {
key: "T"
value {
type: DT_FLOAT
}
}
}
# node {
# name: "a"
# op: "Const"
# attr {
# key: "dtype"
# value {
# type: DT_FLOAT
# }
# }
# attr {
# key: "value"
# value {
# tensor {
# dtype: DT_FLOAT
# tensor_shape {
# dim {
# size: 784
# }
# dim {
# size: 10
# }
# }
# float_val: 0.0
# }
# }
# }
# }
# node {
# name: "Variable"
# op: "Variable"
# ...
# }
# node {
# name: "Variable/Assign"
# op: "Assign"
# input: "Variable"
# input: "a"
# ...
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment