Skip to content

Make tensors generic on their value type - #17

Open
ppraneth wants to merge 2 commits into
mainfrom
genric
Open

ppraneth wants to merge 2 commits into
mainfrom
genric

Conversation

@ppraneth

@ppraneth ppraneth commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #9

  • Tensors, reductions and printing are generic on the value type T, which defaults to f32, so existing code works unchanged
  • LeftComposition can change the value type, e.g. a comparison turns f32 into bool
  • Reductions are defined for f32, f64 and i64
  • where_ takes a bool condition
  • square, negate, scale, clamp and the functions that only move indices are generic
  • pow is removed
  • Kept on f32 on purpose:
    • zeros, ones and eye have no input to infer the type from

@ppraneth
ppraneth requested a review from ValerianRey November 1, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make tensors generic on dtype

1 participant