本文整理匯總了Python中dragnn.python.dragnn_ops.set_asset_directory方法的典型用法代碼示例。如果您正苦於以下問題:Python dragnn_ops.set_asset_directory方法的具體用法?Python dragnn_ops.set_asset_directory怎麽用?Python dragnn_ops.set_asset_directory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dragnn.python.dragnn_ops
的用法示例。
在下文中一共展示了dragnn_ops.set_asset_directory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: build_warmup_graph
# 需要導入模塊: from dragnn.python import dragnn_ops [as 別名]
# 或者: from dragnn.python.dragnn_ops import set_asset_directory [as 別名]
def build_warmup_graph(self, asset_dir):
"""Builds a warmup graph.
This graph performs a MasterSpec asset location rewrite via
SetAssetDirectory, then grabs a ComputeSession and immediately returns it.
By grabbing a session, we cause the underlying transition systems to cache
their static data reads.
Args:
asset_dir: The base directory to append to all resources.
Returns:
A single op suitable for passing to the legacy_init_op of the ModelSaver.
"""
with tf.control_dependencies([dragnn_ops.set_asset_directory(asset_dir)]):
session = self._get_compute_session()
release_op = dragnn_ops.release_session(session)
return tf.group(release_op, name='run')