コード例 #1
0
 def __init__(self):
     self.graph = c_api.TF_NewGraph()
     # Note: when we're destructing the global context (i.e when the process is
     # terminating) we may have already deleted other modules. By capturing the
     # DeleteGraph function here, we retain the ability to cleanly destroy the
     # graph at shutdown, which satisfies leak checkers.
     self.deleter = c_api.TF_DeleteGraph
コード例 #2
0
ファイル: c_api_util.py プロジェクト: wwjiang007/tensorflow
 def __init__(self, name):
   super(ScopedTFGraph, self).__init__(
       name, obj=c_api.TF_NewGraph(), deleter=c_api.TF_DeleteGraph)