osc.utils
Collection of utilities.
Functions
Compute the number of batches in one epoch according to batch size and drop behavior. |
|
Fill diagonal of torch tensor, batched and in-place. |
|
Find the checkpoint with the highest numerical epoch. |
|
Print array/tensor info (name, shape, dtype). |
|
Same as :func: |
|
Seed python, torch, tensorflow, and numpy |
|
Iterate over a flattened dict using dot-separated keys. |
Classes
Keep track of the average value of a metric across batches |
|
Context manager to gracefully handle SIGINT or KeyboardInterrupt. |
|
A simple counter to keep track of update steps. |