Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/link/numba/test_extra_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ def test_UnravelIndex(arr, shape, requires_obj_mode):
pytest.param(
(
pt.vector(),
np.array([0.29769574, 0.71649186, 0.20475563]).astype(config.floatX),
# Must be sorted: searchsorted on unsorted input is undefined
# behavior and numba/numpy implementations disagree there
np.array([0.20475563, 0.29769574, 0.71649186]).astype(config.floatX),
),
(
pt.matrix(),
Expand Down
2 changes: 1 addition & 1 deletion tests/tensor/signal/test_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_convolve2d(kernel_shape, data_shape, mode, boundary, boundary_kwargs):

fn = function([data, kernel], conv_result)

rng = np.random.default_rng((172, kernel_shape, data_shape, sum(map(ord, mode))))
rng = np.random.default_rng((172, *kernel_shape, *data_shape, sum(map(ord, mode))))
data_val = rng.normal(size=data_shape).astype(data.dtype)
kernel_val = rng.normal(size=kernel_shape).astype(kernel.dtype)

Expand Down
7 changes: 4 additions & 3 deletions tests/tensor/test_extra_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ def test_searchsortedOp_on_int_sorter(self, dtype):
)

def test_searchsortedOp_on_right_side(self):
# searchsorted on unsorted input is undefined behavior, and numpy's
# results there depend on its binary search implementation details
sa = self.a[self.idx_sorted]
f = pytensor.function(
[self.x, self.v], searchsorted(self.x, self.v, side="right")
)
assert np.allclose(
np.searchsorted(self.a, self.b, side="right"), f(self.a, self.b)
)
assert np.allclose(np.searchsorted(sa, self.b, side="right"), f(sa, self.b))

def test_infer_shape(self):
# Test using default parameters' value
Expand Down
Loading