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

Function Square

tensorflow/go/op/wrappers.go:32164–32176  ·  view source on GitHub ↗

Computes square of x element-wise. I.e., \\(y = x * x = x^2\\).

(scope *Scope, x tf.Output)

Source from the content-addressed store, hash-verified

32162//
32163// I.e., \\(y = x * x = x^2\\).
32164func Square(scope *Scope, x tf.Output) (y tf.Output) {
32165 if scope.Err() != nil {
32166 return
32167 }
32168 opspec := tf.OpSpec{
32169 Type: "Square",
32170 Input: []tf.Input{
32171 x,
32172 },
32173 }
32174 op := scope.AddOperation(opspec)
32175 return op.Output(0)
32176}
32177
32178// Returns which elements of x are NaN.
32179//

Calls 3

ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 6

TestAddGradientsFunction · 0.56
TestAddGradientsSumsFunction · 0.56