Skip to content

fix(serialization): Skip complex tensors when casting to real dtypes#207

Draft
Eta0 wants to merge 2 commits intomainfrom
eta/complex-casts
Draft

fix(serialization): Skip complex tensors when casting to real dtypes#207
Eta0 wants to merge 2 commits intomainfrom
eta/complex-casts

Conversation

@Eta0
Copy link
Copy Markdown
Collaborator

@Eta0 Eta0 commented Apr 30, 2026

Avoid unsafe complex-to-real casts

This change resolves #206 by disallowing a real dtype passed to a TensorDeserializer from applying to complex-valued tensors, as complex-to-real casts would necessarily lose the imaginary component of such tensors.

Previously, only bool tensors were exempt from casts, so this expands on that exception.

@Eta0 Eta0 self-assigned this Apr 30, 2026
@Eta0 Eta0 added the bug Something isn't working label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tensorizer deserialization converts complex64 tensors to bfloat16, causing assertion failure in Kimi-K2.5 ViT

1 participant