File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ const (
10
10
MaxDimensions = 32
11
11
)
12
12
13
- // Numeric represents the constraint for numeric types that can be used in NdArray
14
- type Numeric interface {
13
+ // NdArrayElementType represents the constraint for numeric types that can be used in NdArray
14
+ type NdArrayElementType interface {
15
15
~ float64
16
16
}
17
17
@@ -24,15 +24,15 @@ type Numeric interface {
24
24
// ResetAppendIndex to reset the array for reuse after sending data.
25
25
//
26
26
// By default, all values in the array are initialized to zero.
27
- type NdArray [T Numeric ] struct {
27
+ type NdArray [T NdArrayElementType ] struct {
28
28
data []T
29
29
shape []uint
30
30
appendIndex uint
31
31
}
32
32
33
33
// NewNDArray creates a new NdArray with the specified shape.
34
34
// All elements are initialized to zero by default.
35
- func NewNDArray [T Numeric ](shape ... uint ) (* NdArray [T ], error ) {
35
+ func NewNDArray [T NdArrayElementType ](shape ... uint ) (* NdArray [T ], error ) {
36
36
if err := validateShape (shape ); err != nil {
37
37
return nil , fmt .Errorf ("invalid shape: %w" , err )
38
38
}
You can’t perform that action at this time.
0 commit comments