#5022·kornia

Vector2 / Vector3 / Scalar 类型的变化与调用路径 (copy.deepcopy 返回的是普通张量, Scalar * Vector3 是 Scalar, torch.linalg.norm(Vector3) 会引发异常) 以及拒绝张量索引 (v[..., 0], v[:, 0], 未批量化的 v[0] 会引发异常)

作者: ducha-aiki创建于 2026年9月27日更新于 2026年9月28日

import copy import torch from kornia.geometry.plane import Hyperplane from kornia.geometry.vector import Scalar, Vector2, Vector3

def attempt(label, fn): try: out = fn() print(f"{label:40} -> {type(out).name} {tuple(out.shape)}") except Exception as e: print(f"{label:40} -> {type(e).name}: {str(e).splitlines()[0][:60]}")

v =