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

Method Shape

tensorflow/go/tensor_handle.go:75–87  ·  view source on GitHub ↗

Shape returns the shape of the Tensor referenced by th.

()

Source from the content-addressed store, hash-verified

73
74// Shape returns the shape of the Tensor referenced by th.
75func (th *TensorHandle) Shape() ([]int64, error) {
76 n, err := th.numDims()
77 if err != nil {
78 return nil, err
79 }
80 r := make([]int64, n)
81 for i := 0; i < n; i++ {
82 if r[i], err = th.dim(i); err != nil {
83 return nil, err
84 }
85 }
86 return r, nil
87}
88
89// numDims returns the number of dimensions of the TensorHandle. It blocks
90// until the operation that produces the handle has completed.

Callers 1

TestTensorHandleShapeFunction · 0.95

Calls 3

numDimsMethod · 0.95
dimMethod · 0.95
makeFunction · 0.85

Tested by 1

TestTensorHandleShapeFunction · 0.76