Skip to content

unsupported-operator for pytorch tensors #908

@PetterS

Description

@PetterS

Summary

Example:

import torch
t = torch.zeros((10, 10))
t ** 2

ty:

error[unsupported-operator]: Operator `**` is unsupported between objects of type `Tensor` and `Literal[2]`
 --> ty_test.py:6:1
  |
5 | t = torch.zeros((10, 10))
6 | t ** 2
  | ^^^^^^
  |
info: rule `unsupported-operator` is enabled by default

Found 1 diagnostic

Other operators like @ and + work.

Version

ty 0.0.1-alpha.16 (c452e53 2025-07-25)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions