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


Python OrderedDict.iteritems方法代码示例

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


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

示例1: OrderedDict

# 需要导入模块: from theano.gof.python25 import OrderedDict [as 别名]
# 或者: from theano.gof.python25.OrderedDict import iteritems [as 别名]
                  shared_inner_outputs)
    if condition is not None:
        inner_outs.append(condition)
    # Cuda is imported here, instead of being imported on top of the file
    # because forces on the user some dependencies that we might do not want
    # to. Currently we are working on removing the dependencies on sandbox
    # code completeley.
    from theano.sandbox import cuda
    if cuda.cuda_available:
        # very often we end up in this situation when we want to
        # replace w with w_copy, where w is CudaNdarray
        # and w_copy is TensorType. This is caused because shared
        # variables are put on GPU right aways >:| ,
        new_givens = OrderedDict()

        for w, w_copy in givens.iteritems():
            if (isinstance(w.type, cuda.CudaNdarrayType)
                and isinstance(w_copy.type, tensor.TensorType)):
                for o in inner_outs:
                    new_givens = traverse(o, w, w_copy, new_givens)
            else:
                new_givens[w] = w_copy
    else:
        new_givens = givens

    new_outs = scan_utils.clone(inner_outs, replace=new_givens)

    ##
    ### Step 7. Create the Scan Op
    ##
开发者ID:SinaHonari,项目名称:Theano,代码行数:32,代码来源:scan.py


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