summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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