Commit a7410c2
* Suggestion to fix the TypeError issue #994 on Windows.
Errors occurs because some ndarrays with dtype=int32
are passed to the function delta_logp which expects
ndarrays with dtype=int64 as inputs. Inputs are casted
with `ndarray.astype(int)`, but on Windows, the
Python 'int' type is treated as a 32-bit integer
by NumPy.
I suggest to remove the line with `f.trust_input = True`
to ensure that Theano always checks the inputs and
casts it if necessary and when possible.
This fix resolves the issue on my computer:
```
Python version:
2.7.12 |Continuum Analytics, Inc.| (default, Jun 29 2016, 11:07:13) [MSC v.1500 64 bit (AMD64)]
OS version:
Windows-8.1-6.3.9600
```
* Discrete super-class raises TypeError if dtype != 'int64'.
Arguments for delta_logp in Metropolis.astep() are now casted to 'int64'
when Metropolis handles a discrete model.
1 parent f61d8cd commit a7410c2
2 files changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
0 commit comments