Created
May 12, 2021 16:25
-
-
Save kretes/408aa8831b6d37ff24df21e5c36fd91c to your computer and use it in GitHub Desktop.
function wrapper to measure execution time in tf graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def measure_time_tf(fun, name): | |
def time_measuring(*args): | |
start = tf.timestamp() | |
result = fun(*args) | |
end = tf.timestamp() | |
diff_times100 = 100.0 * (end - start) | |
tf.print(name, tf.cast(tf.cast(diff_times100, tf.int32), tf.float32) / 100.0) | |
return result | |
return time_measuring |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment