block_compiler.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:fold 作者: tensorflow 项目源码 文件源码
def compile(self, root_block_like):
    """Compiles a block, and sets it to the root.

    Args:
      root_block_like: A block or an object that can be converted to a block by
        [`td.convert_to_block`](#td.convert_to_block). Must have at least one
        output or metric tensor. The output type may not contain any
        Sequence or PyObject types.

    Returns:
      `self`

    Raises:
      RuntimeError: If `init_loom()` has already been called.
      TypeError: If `root_block_like` cannot be converted to a block.
      TypeError: If `root_block_like` fails to compile.
      TypeError: If `root_block_like` has no output or metric tensors.
      TypeError: If `root_block_like` has an invalid output type.
    """
    if self.is_loom_initialized:
      raise RuntimeError('Loom has already been initialized.')
    return self._setup(root_block_like, interactive_mode=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号