diff options
| author | Jonas Knobloch <jonas.knobloch@t-online.de> | 2026-04-11 01:04:29 +0200 |
|---|---|---|
| committer | Jonas Knobloch <jonas.knobloch@t-online.de> | 2026-04-11 01:19:52 +0200 |
| commit | aa1fdb5f3b5d6c54c3bc44269482c31f4dfafe67 (patch) | |
| tree | 2a682d206eae16bfe7c5cb7131161a53ba56ed50 | |
| parent | 6646d95012931966cdbba02fadee5f0b2b52600d (diff) | |
Expose dense shape
| -rw-r--r-- | tensor/dense.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tensor/dense.go b/tensor/dense.go index 9a2deb6..da1a5a0 100644 --- a/tensor/dense.go +++ b/tensor/dense.go @@ -65,6 +65,14 @@ func NewDense[T any](shape []int, base []T) Dense[T] { return out } +func (d Dense[T]) Shape() []int { + shape := make([]int, len(d.shape)) + + copy(shape, d.shape) + + return shape +} + func (d Dense[T]) Size() int { n := 1 |
