Compute flops for L2Loss operation.
(graph, node)
| 113 | |
| 114 | @ops.RegisterStatistics("L2Loss", "flops") |
| 115 | def _l2_loss_flops(graph, node): |
| 116 | """Compute flops for L2Loss operation.""" |
| 117 | in_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0]) |
| 118 | in_shape.assert_is_fully_defined() |
| 119 | # Tensorflow uses inefficient implementation, with (3*N-1) flops: |
| 120 | # Optimal implementation is 2*N flops |
| 121 | return ops.OpStats("flops", in_shape.num_elements() * 3 - 1) |
| 122 | |
| 123 | |
| 124 | @ops.RegisterStatistics("Softmax", "flops") |
nothing calls this directly
no test coverage detected