提交 a115e60a authored 作者: James Bergstra's avatar James Bergstra

added logging

上级 ce7533df
"""Ops and optimizations for using BLAS function calls to evaluate linear algebra expressions""" """Ops and optimizations for using BLAS function calls to evaluate linear algebra expressions"""
import os, sys, traceback import os, sys, traceback, logging
import numpy import numpy
from theano.gof import (utils, Op, Apply, view_roots, PatternSub, DestroyHandler, from theano.gof import (utils, Op, Apply, view_roots, PatternSub, DestroyHandler,
...@@ -17,6 +17,13 @@ from theano import compile #to register the optimizer built by this file ...@@ -17,6 +17,13 @@ from theano import compile #to register the optimizer built by this file
from theano.tensor.blas_headers import cblas_header_text, blas_header_text from theano.tensor.blas_headers import cblas_header_text, blas_header_text
_logger = logging.getLogger('theano.tensor.blas')
def debug(*msg): _logger.debug(' '.join(str(m) for m in msg))
def info(*msg): _logger.info(' '.join(str(m) for m in msg))
def warn(*msg): _logger.warn(' '.join(str(m) for m in msg))
def warning(*msg): _logger.warning(' '.join(str(m) for m in msg))
def error(*msg): _logger.error(' '.join(str(m) for m in msg))
@utils.memoize @utils.memoize
def ldflags(libs=True, flags=False): def ldflags(libs=True, flags=False):
"""Return a list of libraries against which an Op's object file should be """Return a list of libraries against which an Op's object file should be
...@@ -655,6 +662,8 @@ def local_dot_to_dot22(node): ...@@ -655,6 +662,8 @@ def local_dot_to_dot22(node):
x,y = node.inputs x,y = node.inputs
if _is_real_matrix(x) and y.type == x.type: if _is_real_matrix(x) and y.type == x.type:
return [_dot22(*node.inputs)] return [_dot22(*node.inputs)]
else:
info('Not optimizing dot with inputs', x, y)
else: else:
return False return False
register_specialize(local_dot_to_dot22) register_specialize(local_dot_to_dot22)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论