MCPcopy Index your code
hub / github.com/galeone/tfgo / NewTensor

Function NewTensor

tensor.go:34–41  ·  view source on GitHub ↗

NewTensor creates a *Tensor from a tf.Output Place the cloned tensor within the specified scope

(scope *op.Scope, tfout tf.Output)

Source from the content-addressed store, hash-verified

32// NewTensor creates a *Tensor from a tf.Output
33// Place the cloned tensor within the specified scope
34func NewTensor(scope *op.Scope, tfout tf.Output) (tensor *Tensor) {
35 tensor = new(Tensor)
36 tensor.Root = scope
37 tensor.Path = NewScope(scope)
38 // Copy the tensor to a new node in the graph
39 tensor.Output = op.Identity(tensor.Path.SubScope("Identity"), tfout)
40 return tensor
41}
42
43// Check checks if the previous operation caused an error
44// and thus tensor.Path.Err is not nil.

Callers 1

CloneMethod · 0.85

Calls 1

NewScopeFunction · 0.85

Tested by

no test coverage detected