本文整理汇总了Python中theano.gof.COp类的典型用法代码示例。如果您正苦于以下问题:Python COp类的具体用法?Python COp怎么用?Python COp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了COp类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, relu=False, inplace=False):
COp.__init__(self, ["gemm16.c"], "gemm16")
self.relu = relu
# relu = True will require more work in optimizations.
assert self.relu is False
self.inplace = inplace
if self.inplace:
self.destroy_map = {0: [0]}
示例2: __init__
def __init__(self, inplace=False):
theano_cuda_dir = os.path.dirname(theano.sandbox.cuda.__file__)
COp.__init__(self, ["dnn_base.c",
os.path.join(theano_cuda_dir,"dnn_conv_base.c"),
"dnn_gi.c"],
"APPLY_SPECIFIC(conv_gi)")
self.inplace = inplace
if self.inplace:
self.destroy_map = {0: [2]}
示例3: __init__
def __init__(self, border_mode, subsample=(1, 1), conv_mode='conv'):
COp.__init__(self, ["conv_desc.c"], "APPLY_SPECIFIC(conv_desc)")
if isinstance(border_mode, int):
border_mode = (border_mode,) * len(subsample)
if isinstance(border_mode, tuple):
assert len(border_mode) == len(subsample)
border_mode = tuple(map(int, border_mode))
if not ((isinstance(border_mode, tuple) and min(border_mode) >= 0) or
border_mode in ('valid', 'full')):
raise ValueError(
'invalid border_mode {}, which must be either '
'"valid", "full", an integer or a pair of'
' integers'.format(border_mode))
self.border_mode = border_mode
assert len(subsample) in (2, 3)
self.subsample = subsample
assert conv_mode in ('conv', 'cross')
self.conv_mode = conv_mode
示例4: __init__
def __init__(self):
COp.__init__(self, "dnn_base.c")
示例5: __init__
def __init__(self, complete=True):
self.complete = complete
COp.__init__(self, ['c_code/magma_qr.c'], 'APPLY_SPECIFIC(magma_qr)')
示例6: __init__
def __init__(self, inplace=False):
COp.__init__(self, "blockgemv.c", "APPLY_SPECIFIC(blockgemv)")
self.inplace = inplace
if self.inplace:
self.destroy_map = {0: [0]}
示例7: __init__
def __init__(self, inplace=False):
COp.__init__(self, ["c_code/blockger.c"], "APPLY_SPECIFIC(blockger)")
self.inplace = inplace
if self.inplace:
self.destroy_map = {0: [0]}
示例8: __init__
def __init__(self, ...):
COp.__init__(self, c_files, func_name)
示例9: __init__
def __init__(self):
COp.__init__(self, ["doublecop.c"],
"APPLY_SPECIFIC(doublecop)")
示例10: __init__
def __init__(self):
COp.__init__(self, ['GruOp.cu'],
'APPLY_SPECIFIC(gated_unit_main_2)')