本文整理汇总了Python中numba.utils.iteritems函数的典型用法代码示例。如果您正苦于以下问题:Python iteritems函数的具体用法?Python iteritems怎么用?Python iteritems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iteritems函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, context, fndesc, interp):
self.context = context
self.fndesc = fndesc
self.blocks = utils.SortedMap(utils.iteritems(interp.blocks))
# Initialize LLVM
self.module = Module.new("module.%s" % self.fndesc.unique_name)
# Python execution environment (will be available to the compiled
# function).
self.env = _dynfunc.Environment(
globals=self.fndesc.lookup_module().__dict__)
# Setup function
self.function = context.declare_function(self.module, fndesc)
self.entry_block = self.function.append_basic_block('entry')
self.builder = Builder.new(self.entry_block)
# Internal states
self.blkmap = {}
self.varmap = {}
self.firstblk = min(self.blocks.keys())
self.loc = -1
# Subclass initialization
self.init()
开发者ID:yuvallanger,项目名称:numba,代码行数:26,代码来源:lowering.py
示例2: inspect_types
def inspect_types(self, file=None, **kwargs):
"""
print or return annotated source with Numba intermediate IR
Pass `pretty=True` to attempt color highlighting, and HTML rendering in
Jupyter and IPython by returning an Annotate Object. `file` must be
None if used in conjunction with `pretty=True`.
"""
pretty = kwargs.get('pretty', False)
style = kwargs.get('style', 'default')
if not pretty:
if file is None:
file = sys.stdout
for ver, res in utils.iteritems(self.overloads):
print("%s %s" % (self.py_func.__name__, ver), file=file)
print('-' * 80, file=file)
print(res.type_annotation, file=file)
print('=' * 80, file=file)
else:
if file is not None:
raise ValueError("`file` must be None if `pretty=True`")
from .pretty_annotate import Annotate
return Annotate(self, style=style)
开发者ID:numba,项目名称:numba,代码行数:25,代码来源:dispatcher.py
示例3: inspect_types
def inspect_types(self, file=None):
if file is None:
file = sys.stdout
for ver, res in utils.iteritems(self.overloads):
print("%s %s" % (self.py_func.__name__, ver), file=file)
print('-' * 80, file=file)
print(res.type_annotation, file=file)
print('=' * 80, file=file)
开发者ID:FedericoStra,项目名称:numba,代码行数:9,代码来源:dispatcher.py
示例4: dump
def dump(self):
def label_marker(i):
if i[1].offset in self.labels:
return '>'
else:
return ' '
return '\n'.join('%s %10s\t%s' % ((label_marker(i),) + i)
for i in utils.iteritems(self.table))
开发者ID:sklam,项目名称:numba,代码行数:9,代码来源:bytecode.py
示例5: inspect_types
def inspect_types(self, file=None):
'''
Produce a dump of the Python source of this function annotated with the
corresponding Numba IR and type information. The dump is written to
*file*, or *sys.stdout* if *file* is *None*.
'''
if file is None:
file = sys.stdout
for ver, defn in utils.iteritems(self.definitions):
defn.inspect_types(file=file)
开发者ID:Alexhuszagh,项目名称:numba,代码行数:11,代码来源:compiler.py
示例6: insert_class
def insert_class(self, cls, attrs):
clsty = types.Object(cls)
for name, vtype in utils.iteritems(attrs):
imp = python_attr_impl(clsty, name, vtype)
self.attrs[imp.attr].append(imp)
开发者ID:meawoppl,项目名称:numba,代码行数:5,代码来源:base.py
示例7: run
def run(self):
for blkid, blk in utils.iteritems(self.interp.blocks):
self.run_block(blk)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:3,代码来源:irpasses.py
示例8: inspect_types
def inspect_types(self, file=None):
if file is None:
file = sys.stdout
for ver, defn in utils.iteritems(self.definitions):
defn.inspect_types(file=file)
开发者ID:PierreBizouard,项目名称:numba,代码行数:6,代码来源:compiler.py
注:本文中的numba.utils.iteritems函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论