Fused kernel for batch normalization.
(tensor, mean, variance, beta, gamma, scale)
| 38 | |
| 39 | |
| 40 | def batch_norm_op(tensor, mean, variance, beta, gamma, scale): |
| 41 | """Fused kernel for batch normalization.""" |
| 42 | # _batch_norm_with_global_normalization is deprecated in v9 |
| 43 | test_util.set_producer_version(ops.get_default_graph(), 8) |
| 44 | # pylint: disable=protected-access |
| 45 | return gen_nn_ops._batch_norm_with_global_normalization( |
| 46 | tensor, mean, variance, beta, gamma, 0.001, scale) |
| 47 | # pylint: enable=protected-access |
| 48 | |
| 49 | |
| 50 | # Note that the naive implementation is much slower: |