标签:int work 另一个 obj spl created constant rap tensor
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 23 11:26:04 2018
@author: myhaspl
"""
import tensorflow as tf
#创建图
c=tf.constant(0.0)
g=tf.Graph()
with g.as_default():
c1=tf.constant(0.1)
print(c1.graph)
print(g)
print(c.graph)
<tensorflow.python.framework.ops.Graph object at 0xb1cd345c0>
<tensorflow.python.framework.ops.Graph object at 0xb1cd345c0>
<tensorflow.python.framework.ops.Graph object at 0x10d1f6160>
从输出可以看出
print(c1.graph)
print(g)
输出为同一个计算图,
而 print(c.graph)为另一个计算图
标签:int work 另一个 obj spl created constant rap tensor
原文地址:http://blog.51cto.com/13959448/2334218