Skip to content

Python REPL display bug with PyTorch #1383

@Selozhd

Description

@Selozhd

Describe the bug
Python REPL throws an error when displaying a PyTorch tensor when dowhy is loaded. First noticed this on VsCode while using the terminal. Here is the minimum reproducible code.

Steps to reproduce the behavior

import sys
import torch
from dowhy import gcm

x = torch.randn(3,4) # this step is fine
x.__repr__() # this is also fine
sys.displayhook(x) # this is the display function which throws an error.

Version information:

  • dowhy==0.14
  • torch==2.10.0
  • Python 3.12.11
  • MacOS 26.2

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions