Removes dimensions of size 1 from the shape of a tensor. Given a tensor `input`, this operation returns a tensor of the same type with all dimensions of size 1 removed. If you don't want to remove all size 1 dimensions, you can remove specific size 1 dimensions by specifying `axis`. For example:
(scope *Scope, input tf.Output, optional ...SqueezeAttr)
| 1249 | // Returns Contains the same data as `input`, but has one or more dimensions of |
| 1250 | // size 1 removed. |
| 1251 | func Squeeze(scope *Scope, input tf.Output, optional ...SqueezeAttr) (output tf.Output) { |
| 1252 | if scope.Err() != nil { |
| 1253 | return |
| 1254 | } |
| 1255 | attrs := map[string]interface{}{} |
| 1256 | for _, a := range optional { |
| 1257 | a(attrs) |
| 1258 | } |
| 1259 | opspec := tf.OpSpec{ |
| 1260 | Type: "Squeeze", |
| 1261 | Input: []tf.Input{ |
| 1262 | input, |
| 1263 | }, |
| 1264 | Attrs: attrs, |
| 1265 | } |
| 1266 | op := scope.AddOperation(opspec) |
| 1267 | return op.Output(0) |
| 1268 | } |
| 1269 | |
| 1270 | // Inserts a dimension of 1 into a tensor's shape. |
| 1271 | // |