Commonly-used helper functions#

The following helper functions are commonly-used when preparing data and models for use with plenoptic.

remove_grad

Detach all parameters and buffers of model (in place).

set_seed

Set the seed.

load_images

Load in images.

to_numpy

Cast tensor to numpy in the most conservative way possible.

convert_float_to_int

Convert numpy array from float to 8 or 16 bit integer.