torch_mimicry.utils¶
Contents
Common Utilities¶
Script for common utility functions.
-
load_from_json
(json_file)[source]¶ Loads a JSON file as a dictionary and return it.
Parameters: json_file (str) – Input JSON file to read. Returns: Dictionary loaded from the JSON file. Return type: dict
-
load_images
(n=1, size=32)[source]¶ Load n image tensors with some fake labels.
Parameters: Returns: Random images of shape (n, 3, size, size) and 0-valued labels.
Return type: Tensor