25 lines
467 B
Go
25 lines
467 B
Go
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|||
|
|
// SPDX-License-Identifier: MIT
|
||
|
|
|
||
|
|
package tensor
|
||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
func mustFromFloatsT(t *testing.T, v float64) *Array {
|
||
|
|
t.Helper()
|
||
|
|
a, err := FromFloats([]float64{v}, 1)
|
||
|
|
if err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
return a
|
||
|
|
}
|
||
|
|
|
||
|
|
func FromFloatsMustT(t *testing.T, vals []float64) *Array {
|
||
|
|
t.Helper()
|
||
|
|
a, err := FromFloats(vals, len(vals))
|
||
|
|
if err != nil {
|
||
|
|
t.Fatal(err)
|
||
|
|
}
|
||
|
|
return a
|
||
|
|
}
|