Skip to content

Cholesky returns truncated integer outputs for integer inputs #1071

@ricardoV94

Description

@ricardoV94

Description

import pytensor.tensor as pt
import numpy as np
import scipy as sp

x = np.array([[2]])
print(
    pt.linalg.cholesky(x).eval(),
    np.linalg.cholesky(x),
    sp.linalg.cholesky(x),
) # [[1]] [[1.41421356]] [[1.41421356]]

Probably make_node is suggesting the output is just input.type() (that is the same shape and dtype as the input). May be worth it to investigate if this is more widespread in the linalg module

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions