Skip to content

Instantly share code, notes, and snippets.

View baratrion's full-sized avatar

Mehmet Catalbas baratrion

View GitHub Profile
@baratrion
baratrion / test_flow.py
Created February 2, 2021 15:00
Line-by-line memory profiling for Metaflow
from functools import wraps, partial
from metaflow import FlowSpec, catch, step
def profile_memory(f):
@wraps(f)
def func(self, *args, **kwargs):
from memory_profiler import choose_backend, LineProfiler, show_results
backend = choose_backend('psutil')