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

Function tensorData

tensorflow/go/tensor.go:203–212  ·  view source on GitHub ↗
(c *C.TF_Tensor)

Source from the content-addressed store, hash-verified

201}
202
203func tensorData(c *C.TF_Tensor) []byte {
204 // See: https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
205 cbytes := C.TF_TensorData(c)
206 if cbytes == nil {
207 return nil
208 }
209 length := int(C.TF_TensorByteSize(c))
210 slice := (*[1 << 30]byte)(unsafe.Pointer(cbytes))[:length:length]
211 return slice
212}
213
214var types = []struct {
215 typ reflect.Type

Callers 4

NewTensorFunction · 0.85
ReadTensorFunction · 0.85
ValueMethod · 0.85
WriteContentsToMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected