Computes square of x element-wise. I.e., \\(y = x * x = x^2\\).
(scope *Scope, x tf.Output)
| 32162 | // |
| 32163 | // I.e., \\(y = x * x = x^2\\). |
| 32164 | func 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 | // |