当前位置: 首页>>代码示例>>Python>>正文


Python dragnn_ops.attach_data_reader方法代码示例

本文整理汇总了Python中dragnn.python.dragnn_ops.attach_data_reader方法的典型用法代码示例。如果您正苦于以下问题:Python dragnn_ops.attach_data_reader方法的具体用法?Python dragnn_ops.attach_data_reader怎么用?Python dragnn_ops.attach_data_reader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dragnn.python.dragnn_ops的用法示例。


在下文中一共展示了dragnn_ops.attach_data_reader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_session_with_reader

# 需要导入模块: from dragnn.python import dragnn_ops [as 别名]
# 或者: from dragnn.python.dragnn_ops import attach_data_reader [as 别名]
def _get_session_with_reader(self, enable_tracing):
    """Utility to create ComputeSession management ops.

    Creates a new ComputeSession handle and provides the following
    named nodes:

    ComputeSession/InputBatch -- a placeholder for attaching a string
      specification for AttachReader.
    ComputeSession/AttachReader -- the AttachReader op.

    Args:
      enable_tracing: bool, whether to enable tracing before attaching the data.

    Returns:
      handle: handle to a new ComputeSession returned by the AttachReader op.
      input_batch: InputBatch placeholder.
    """
    with tf.name_scope('ComputeSession'):
      input_batch = tf.placeholder(
          dtype=tf.string, shape=[None], name='InputBatch')

      # Get the ComputeSession and chain some essential ops.
      handle = self._get_compute_session()
      if enable_tracing:
        handle = dragnn_ops.set_tracing(handle, True)
      handle = dragnn_ops.attach_data_reader(
          handle, input_batch, name='AttachReader')

    return handle, input_batch 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:31,代码来源:graph_builder.py


注:本文中的dragnn.python.dragnn_ops.attach_data_reader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。