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

Function TestTensorHandleToTensor

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

Source from the content-addressed store, hash-verified

110}
111
112func TestTensorHandleToTensor(t *testing.T) {
113 initialVals := [][]float32{{1.0, 2.0}, {3.0, 4.0}}
114 initialTensor, err := NewTensor(initialVals)
115 if err != nil {
116 t.Fatal(err)
117 }
118 th, err := NewTensorHandle(initialTensor)
119 if err != nil {
120 t.Fatal(err)
121 }
122
123 tensor, err := th.ToTensor()
124 if v := tensor.Value().([][]float32); !reflect.DeepEqual(v, initialVals) {
125 t.Errorf("Got %#v, want %#v", v, initialVals)
126 }
127}

Callers

nothing calls this directly

Calls 4

ToTensorMethod · 0.95
NewTensorFunction · 0.85
NewTensorHandleFunction · 0.85
ValueMethod · 0.45

Tested by

no test coverage detected