Batch normalization. Note that the size of 4D Tensors are defined by either "NHWC" or "NCHW". The size of 1D Tensors matches the dimension C of the 4D Tensors. Arguments: x: A 4D Tensor for input data. scale: A 1D Tensor for scaling factor, to scale the normalized x. offset: A 1D Tensor for off
(scope *Scope, x tf.Output, scale tf.Output, offset tf.Output, mean tf.Output, variance tf.Output, optional ...FusedBatchNormV3Attr)
| 12048 | // in the cuDNN case), to be reused in the gradient computation.A 1D Tensor for some intermediate results, to be reused in the gradient |
| 12049 | // computation for better efficiency. |
| 12050 | func FusedBatchNormV3(scope *Scope, x tf.Output, scale tf.Output, offset tf.Output, mean tf.Output, variance tf.Output, optional ...FusedBatchNormV3Attr) (y tf.Output, batch_mean tf.Output, batch_variance tf.Output, reserve_space_1 tf.Output, reserve_space_2 tf.Output, reserve_space_3 tf.Output) { |
| 12051 | if scope.Err() != nil { |
| 12052 | return |
| 12053 | } |
| 12054 | attrs := map[string]interface{}{} |
| 12055 | for _, a := range optional { |
| 12056 | a(attrs) |
| 12057 | } |
| 12058 | opspec := tf.OpSpec{ |
| 12059 | Type: "FusedBatchNormV3", |
| 12060 | Input: []tf.Input{ |
| 12061 | x, scale, offset, mean, variance, |
| 12062 | }, |
| 12063 | Attrs: attrs, |
| 12064 | } |
| 12065 | op := scope.AddOperation(opspec) |
| 12066 | return op.Output(0), op.Output(1), op.Output(2), op.Output(3), op.Output(4), op.Output(5) |
| 12067 | } |
| 12068 | |
| 12069 | // FusedBatchNormV2Attr is an optional argument to FusedBatchNormV2. |
| 12070 | type FusedBatchNormV2Attr func(optionalAttr) |