• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python blas.ldflags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中theano.tensor.blas.ldflags函数的典型用法代码示例。如果您正苦于以下问题:Python ldflags函数的具体用法?Python ldflags怎么用?Python ldflags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: check_force_gemv_init

def check_force_gemv_init():
    if check_force_gemv_init._force_init_beta is None:
        from theano.gof.cmodule import GCC_compiler
        """
        Test issue 1569.
        Namely when evaluating

            beta*y + alpha*dot(A, x)

        where we set y * beta = zeros of the correct dimensions we
        do not actually set y = zeros and instead let the BLAS
        perform beta*y with uninitialized memory for
        speed. Occasionally the memory contains values that are
        equivalent to NaN in which case the product beta*y contains
        NaN's for correctly implemented BLAS libraries. In this
        situation, since we are introducing the NaN's, we need to test
        whether the BLAS performs correctly. If it *does*, i.e. it
        actually performs the multiplication beta*y which will result
        in NaN's in the result, then we need intialize the memory to
        zeros.
        """
        test_code = """
#include <math.h>
extern "C" void dgemv_(char*, const int*, const int*, const double *, const double *, const int*, const double *, const int*, const double *, double *, const int *);
int main() {
  double A[2][2] = {{1., 1.}, {1., 1.}};
  double x[2] = {1., 1.};
  double y[2] = {NAN, NAN};
  const int s = 2;
  const int inc = 1;
  const double alpha = 1.0;
  const double beta = 0.0;

  dgemv_("T", &s, &s, &alpha, A, &s, x, &inc, &beta, &y, &inc);

  return (isnan(y[0]) || isnan(y[1]) ? 1 : 0;
}
"""
        res = GCC_compiler.try_compile_tmp(test_code, tmp_prefix='check_beta_',
                                           flags=ldflags(libs=True, flags=True,
                                                         libs_dir=True),
                                           try_run=True)
        if res:
            if res[0]:
                check_force_gemv_init._force_init_beta = res[1]
            else:
                check_force_gemv_init._force_init_beta = False
        else:
            check_force_gemv_init._force_init_beta = False

    return check_force_gemv_init._force_init_beta
开发者ID:EugenePY,项目名称:Theano,代码行数:51,代码来源:blas_c.py


示例2: c_header_dirs

 def c_header_dirs(self):
     return ldflags(libs=False, include_dir=True)
开发者ID:ChinaQuants,项目名称:Theano,代码行数:2,代码来源:corr.py


示例3: c_lib_dirs

 def c_lib_dirs(self):
     return ldflags(libs=False, libs_dir=True)
开发者ID:ChinaQuants,项目名称:Theano,代码行数:2,代码来源:corr.py


示例4: c_compile_args

 def c_compile_args(self):
     compile_args = ldflags(libs=False, flags=True)
     compile_args += super(BaseCorrMM, self).c_compile_args()
     return compile_args
开发者ID:ChinaQuants,项目名称:Theano,代码行数:4,代码来源:corr.py


示例5: c_libraries

 def c_libraries(self):
     return ldflags()
开发者ID:ChinaQuants,项目名称:Theano,代码行数:2,代码来源:corr.py


示例6: c_compile_args

 def c_compile_args(self):
     return ldflags(libs=False, flags=True)
开发者ID:huamichaelchen,项目名称:Theano,代码行数:2,代码来源:corr.py


示例7: c_compile_args

 def c_compile_args(self):
     flags =  ldflags(libs=False, flags=True)
     flags.append('-Werror')
     return flags
开发者ID:HaniAlmousli,项目名称:Theano,代码行数:4,代码来源:Conv3D.py


示例8: c_libraries

 def c_libraries(self):
     return blas.ldflags()
开发者ID:lberrada,项目名称:Theano,代码行数:2,代码来源:sp2.py


示例9: c_compile_args

 def c_compile_args(self):
     compile_args = ldflags(libs=False, flags=True)
     compile_args += super(MKLOp, self).c_compile_args()
     return compile_args
开发者ID:intel,项目名称:theano,代码行数:4,代码来源:basic_ops.py


示例10: c_compile_args

 def c_compile_args(self):
     compile_args = ldflags(libs=False, flags=True)
     compile_args += super(Concatenate, self).c_compile_args()
     return compile_args
开发者ID:pcs-theano,项目名称:Theano,代码行数:4,代码来源:mkl_concatenate.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python extra_ops.cumsum函数代码示例发布时间:2022-05-27
下一篇:
Python basic.sum函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap