提交 701beaa3 authored 作者: amrithasuresh's avatar amrithasuresh

Updated numpy as np

上级 818985b0
...@@ -14,7 +14,7 @@ The config option is in configdefaults.py ...@@ -14,7 +14,7 @@ The config option is in configdefaults.py
This note is written by Li Yao. This note is written by Li Yao.
""" """
from collections import OrderedDict from collections import OrderedDict
import numpy import numpy as np
import six.moves.cPickle as pickle import six.moves.cPickle as pickle
import theano import theano
import theano.tensor as T import theano.tensor as T
...@@ -28,8 +28,8 @@ def test_pickle_unpickle_with_reoptimization(): ...@@ -28,8 +28,8 @@ def test_pickle_unpickle_with_reoptimization():
mode = "FAST_RUN" mode = "FAST_RUN"
x1 = T.fmatrix('x1') x1 = T.fmatrix('x1')
x2 = T.fmatrix('x2') x2 = T.fmatrix('x2')
x3 = theano.shared(numpy.ones((10, 10), dtype=floatX)) x3 = theano.shared(np.ones((10, 10), dtype=floatX))
x4 = theano.shared(numpy.ones((10, 10), dtype=floatX)) x4 = theano.shared(np.ones((10, 10), dtype=floatX))
y = T.sum(T.sum(T.sum(x1 ** 2 + x2) + x3) + x4) y = T.sum(T.sum(T.sum(x1 ** 2 + x2) + x3) + x4)
updates = OrderedDict() updates = OrderedDict()
...@@ -40,8 +40,8 @@ def test_pickle_unpickle_with_reoptimization(): ...@@ -40,8 +40,8 @@ def test_pickle_unpickle_with_reoptimization():
# now pickle the compiled theano fn # now pickle the compiled theano fn
string_pkl = pickle.dumps(f, -1) string_pkl = pickle.dumps(f, -1)
in1 = numpy.ones((10, 10), dtype=floatX) in1 = np.ones((10, 10), dtype=floatX)
in2 = numpy.ones((10, 10), dtype=floatX) in2 = np.ones((10, 10), dtype=floatX)
# test unpickle with optimization # test unpickle with optimization
default = theano.config.reoptimize_unpickled_function default = theano.config.reoptimize_unpickled_function
...@@ -60,8 +60,8 @@ def test_pickle_unpickle_without_reoptimization(): ...@@ -60,8 +60,8 @@ def test_pickle_unpickle_without_reoptimization():
mode = "FAST_RUN" mode = "FAST_RUN"
x1 = T.fmatrix('x1') x1 = T.fmatrix('x1')
x2 = T.fmatrix('x2') x2 = T.fmatrix('x2')
x3 = theano.shared(numpy.ones((10, 10), dtype=floatX)) x3 = theano.shared(np.ones((10, 10), dtype=floatX))
x4 = theano.shared(numpy.ones((10, 10), dtype=floatX)) x4 = theano.shared(np.ones((10, 10), dtype=floatX))
y = T.sum(T.sum(T.sum(x1**2 + x2) + x3) + x4) y = T.sum(T.sum(T.sum(x1**2 + x2) + x3) + x4)
updates = OrderedDict() updates = OrderedDict()
...@@ -73,8 +73,8 @@ def test_pickle_unpickle_without_reoptimization(): ...@@ -73,8 +73,8 @@ def test_pickle_unpickle_without_reoptimization():
string_pkl = pickle.dumps(f, -1) string_pkl = pickle.dumps(f, -1)
# compute f value # compute f value
in1 = numpy.ones((10, 10), dtype=floatX) in1 = np.ones((10, 10), dtype=floatX)
in2 = numpy.ones((10, 10), dtype=floatX) in2 = np.ones((10, 10), dtype=floatX)
# test unpickle without optimization # test unpickle without optimization
default = theano.config.reoptimize_unpickled_function default = theano.config.reoptimize_unpickled_function
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论