MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TestTensorHandleShape

Function TestTensorHandleShape

tensorflow/go/tensor_handle_test.go:52–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestTensorHandleShape(t *testing.T) {
53 vals := [][]float32{{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}}
54 tensor, err := NewTensor(vals)
55 if err != nil {
56 t.Fatal(err)
57 }
58 th, err := NewTensorHandle(tensor)
59 if err != nil {
60 t.Fatal(err)
61 }
62
63 got, err := th.Shape()
64 if err != nil {
65 t.Fatal(err)
66 }
67 if want := []int64{2, 3}; !reflect.DeepEqual(got, want) {
68 t.Errorf("Got %#v, want %#v", got, want)
69 }
70}
71
72func TestTensorHandleDeviceName(t *testing.T) {
73 vals := [][]float32{{1.0, 2.0}, {3.0, 4.0}}

Callers

nothing calls this directly

Calls 3

ShapeMethod · 0.95
NewTensorFunction · 0.85
NewTensorHandleFunction · 0.85

Tested by

no test coverage detected