Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGemv fails with strides0 x #1262

Open
ricardoV94 opened this issue Mar 4, 2025 · 0 comments · May be fixed by #1266
Open

CGemv fails with strides0 x #1262

ricardoV94 opened this issue Mar 4, 2025 · 0 comments · May be fixed by #1266
Labels
bug Something isn't working C-backend

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Mar 4, 2025

Description

import pytensor
import pytensor.tensor as pt
import numpy as np
from pytensor.compile.mode import get_mode
from pytensor.tensor.blas_c import CGemv

A = pt.tensor("A", shape=(None, None))
x = pt.tensor("x", shape=(None,))

out = CGemv(inplace=False)(
    pt.empty(A.shape[0]),
    pt.constant(np.array(1.0, dtype="float64")),
    A,
    x,
    pt.constant(np.array(0.0, dtype="float64"))
)
fn = pytensor.function([A, x], out)
A_test = np.array([[1.0]], dtype="float64")
x_test = np.array(1.0, dtype="float64")
x_test = np.broadcast_to(x_test, (1,))  # x_test.strides == (0,)
fn(A_test, x_test)  # Intel oneMKL ERROR: Parameter 8 was incorrect on entry to DGEMV .

This showed up in a PyMC test now that DimShuffle creates 0-strides inputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C-backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant