• Frederic's avatar
    Make opt faster by calling get_scalar_constant_value() only on constant. · 64d621b4
    Frederic 提交于
    This last commit finish to bring from 584s to 66s the slow scan test:
    theano/scan_module/tests/test_scan.py:T_Scan.test_hessian_bug_grad_grad_two_scans
    
    The changed optimization:
    
    local_abs_merge, local_mul_switch_sink,
    local_upcast_elemwise_constant_inputs,
    local_remove_switch_const_con
    
    are called on nodes that aren't yet part of the graph, during
    local_subtensor_merge optimization. They aren't supposed to work on
    node that are in the graph, but as they called
    get_scalar_constant_value() they traversed it very frequently!
    
    This pre_greedy_local_optimizer call is needed as it would introduce
    too much scrapt that will be optimized away. So we preoptimize the
    graph.
    
    As now we do the constant_folding in the phase
    (canonicalize/stabilize/specialize) where those changed opt are used,
    they can work directly on Constant. Other opt will make sure their
    inputs get constant if possible.
    64d621b4
名称
最后提交
最后更新
benchmark 正在载入提交数据...
bin 正在载入提交数据...
doc 正在载入提交数据...
theano 正在载入提交数据...
.gitignore 正在载入提交数据...
.mailmap 正在载入提交数据...
.travis.yml 正在载入提交数据...
DESCRIPTION.txt 正在载入提交数据...
EMAIL.txt 正在载入提交数据...
HISTORY.txt 正在载入提交数据...
LICENSE.txt 正在载入提交数据...
MANIFEST.in 正在载入提交数据...
NEWS.txt 正在载入提交数据...
NEWS_DEV.txt 正在载入提交数据...
README.txt 正在载入提交数据...
Theano.pyproj 正在载入提交数据...
Theano.sln 正在载入提交数据...
setup.cfg 正在载入提交数据...
setup.py 正在载入提交数据...