summaryrefslogtreecommitdiff
path: root/tensor
diff options
context:
space:
mode:
authorJonas Knobloch <jonas.knobloch@t-online.de>2026-04-11 01:04:29 +0200
committerJonas Knobloch <jonas.knobloch@t-online.de>2026-04-11 01:19:52 +0200
commitaa1fdb5f3b5d6c54c3bc44269482c31f4dfafe67 (patch)
tree2a682d206eae16bfe7c5cb7131161a53ba56ed50 /tensor
parent6646d95012931966cdbba02fadee5f0b2b52600d (diff)
Expose dense shape
Diffstat (limited to 'tensor')
-rw-r--r--tensor/dense.go8
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