Skip to content

Commit

Permalink
Small compatibility fix for master of Theano-PyMc (#4293)
Browse files Browse the repository at this point in the history
* Update theano-pymc version

* Update infer_shape signatures

* Updates for new double-underscore config settings

Co-authored-by: Brandon T. Willard <[email protected]>
  • Loading branch information
semohr and brandonwillard authored Dec 10, 2020
1 parent 0431292 commit 4fd56fd
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arviz_compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=native'
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=native'
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
TEST_SUBSET: ${{ matrix.test-subset }}
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc.cxxflags='-march=core2'
THEANO_FLAGS: floatX=${{ matrix.floatx }},gcc__cxxflags='-march=core2'
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-dev-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- python=3.6
- arviz>=0.9
- theano-pymc==1.0.11
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-dev-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- python=3.7
- arviz>=0.9
- theano-pymc==1.0.11
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
Expand Down
2 changes: 1 addition & 1 deletion conda-envs/environment-dev-py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
dependencies:
- python=3.8
- arviz>=0.9
- theano-pymc==1.0.11
- theano-pymc==1.0.12
- numpy>=1.13
- scipy>=0.18
- pandas>=0.18
Expand Down
4 changes: 2 additions & 2 deletions pymc3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def __set_compiler_flags():
# Workarounds for Theano compiler problems on various platforms
import theano

current = theano.config.gcc.cxxflags
theano.config.gcc.cxxflags = f"{current} -Wno-c++11-narrowing"
current = theano.config.gcc__cxxflags
theano.config.gcc__cxxflags = f"{current} -Wno-c++11-narrowing"


__set_compiler_flags()
Expand Down
2 changes: 1 addition & 1 deletion pymc3/distributions/multivariate.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def perform(self, node, inputs, outputs):
pm._log.exception("Failed to check if %s positive definite", x)
raise

def infer_shape(self, node, shapes):
def infer_shape(self, fgraph, node, shapes):
return [[]]

def grad(self, inp, grads):
Expand Down
4 changes: 2 additions & 2 deletions pymc3/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def grad(self, inputs, gout):
idx = tt.arange(gz.shape[-1])
return [gz[..., idx, idx]]

def infer_shape(self, nodes, shapes):
def infer_shape(self, fgraph, nodes, shapes):
return [(shapes[0][0],) + (shapes[0][1],) * 2]


Expand Down Expand Up @@ -422,7 +422,7 @@ def grad(self, inputs, gout):
]
return [gout[0][slc] for slc in slices]

def infer_shape(self, nodes, shapes):
def infer_shape(self, fgraph, nodes, shapes):
first, second = zip(*shapes)
return [(tt.add(*first), tt.add(*second))]

Expand Down
2 changes: 1 addition & 1 deletion pymc3/ode/ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def perform(self, node, inputs_storage, output_storage):
# simulate states and sensitivities in one forward pass
output_storage[0][0], output_storage[1][0] = self._simulate(y0, theta)

def infer_shape(self, node, input_shapes):
def infer_shape(self, fgraph, node, input_shapes):
s_y0, s_theta = input_shapes
output_shapes = [(self.n_times, self.n_states), (self.n_times, self.n_states, self.n_p)]
return output_shapes
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ numpy>=1.13.0
pandas>=0.18.0
patsy>=0.5.1
scipy>=0.18.1
theano-pymc==1.0.11
theano-pymc==1.0.12
typing-extensions>=3.7.4
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e

_FLOATX=${FLOATX:=float64}
THEANO_FLAGS="floatX=${_FLOATX},gcc.cxxflags='-march=core2'" pytest -v --cov=pymc3 --cov-report=xml "$@" --cov-report term
THEANO_FLAGS="floatX=${_FLOATX},gcc__cxxflags='-march=core2'" pytest -v --cov=pymc3 --cov-report=xml "$@" --cov-report term

0 comments on commit 4fd56fd

Please sign in to comment.