MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _softmax_flops

Function _softmax_flops

tensorflow/python/profiler/internal/flops_registry.py:125–133  ·  view source on GitHub ↗

Compute flops for Softmax operation.

(graph, node)

Source from the content-addressed store, hash-verified

123
124@ops.RegisterStatistics("Softmax", "flops")
125def _softmax_flops(graph, node):
126 """Compute flops for Softmax operation."""
127 # Softmax implenetation:
128 #
129 # Approximate flops breakdown:
130 # 2*n -- compute shifted logits
131 # n -- exp of shifted logits
132 # 2*n -- compute softmax from exp of shifted logits
133 return _unary_op_flops(graph, node, ops_per_element=5)
134
135################################################################################
136# Binary operations

Callers

nothing calls this directly

Calls 1

_unary_op_flopsFunction · 0.85

Tested by

no test coverage detected