libreasr.lib.utils

Useful little functions

Functions

chained_try

check

Check if tensor t is numerically correct.

cudaize

hook_debug

print the mean and std of all activations while data is flowing through your model Warning: this removes all hooks from your model!

maybe_quantize

n_params

Get the number of parameters for a PyTorch nn.Module m

noop

Do nothing

qna

q and a about your model.

sanitize_str

standardize

stats

tensorize

what

this can’t handle generators :(

wrap_transform

Classes

Text