|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -import warnings |
16 |
| - |
17 | 15 | import numpy as np
|
18 | 16 | import pymc as pm
|
19 | 17 |
|
|
23 | 21 | from pytensor import tensor as pt
|
24 | 22 | from pytensor.tensor.random.op import RandomVariable
|
25 | 23 |
|
26 |
| -warnings.filterwarnings("ignore", category=FutureWarning, message="ndims_params is deprecated") |
27 |
| - |
28 | 24 |
|
29 | 25 | def log1mexp(x):
|
30 | 26 | cond = x < np.log(0.5)
|
@@ -409,18 +405,12 @@ def dist(cls, mu1, mu2, **kwargs):
|
409 | 405 | class GrassiaIIGeometricRV(RandomVariable):
|
410 | 406 | name = "g2g"
|
411 | 407 | signature = "(),(),()->()"
|
412 |
| - ndims_params = [0, 0, 0] # deprecated in PyTensor 2.31.7, but still required for RandomVariable |
413 | 408 |
|
414 | 409 | dtype = "int64"
|
415 | 410 | _print_name = ("GrassiaIIGeometric", "\\operatorname{GrassiaIIGeometric}")
|
416 | 411 |
|
417 | 412 | @classmethod
|
418 | 413 | def rng_fn(cls, rng, r, alpha, time_covariate_vector, size):
|
419 |
| - # Cast inputs as numpy arrays |
420 |
| - r = np.asarray(r, dtype=np.float64) |
421 |
| - alpha = np.asarray(alpha, dtype=np.float64) |
422 |
| - time_covariate_vector = np.asarray(time_covariate_vector, dtype=np.float64) |
423 |
| - |
424 | 414 | # Determine output size
|
425 | 415 | if size is None:
|
426 | 416 | size = np.broadcast_shapes(r.shape, alpha.shape, time_covariate_vector.shape)
|
@@ -525,8 +515,6 @@ def logp(value, r, alpha, time_covariate_vector=None):
|
525 | 515 | time_covariate_vector = pt.as_tensor_variable(time_covariate_vector)
|
526 | 516 |
|
527 | 517 | def C_t(t):
|
528 |
| - if t == 0: |
529 |
| - return pt.constant(0.0) |
530 | 518 | if time_covariate_vector.ndim == 0:
|
531 | 519 | return t
|
532 | 520 | else:
|
|
0 commit comments