tonic.prototype.datasets.utils._utils#

Module Contents#

Functions#

check_sha256(→ str)

Function that checks the SHA256 of the archive/dataset. In torchvision they strongly

tonic.prototype.datasets.utils._utils.check_sha256(fpath: Union[str, pathlib.Path], sha256_provided: str, chunk_size: Optional[int] = 1024 * 1024) str[source]#

Function that checks the SHA256 of the archive/dataset. In torchvision they strongly recommend to switch to SHA256 from MD5. This function is inspired by torchvision.prototype.datasets.utils._resource.

Parameters:
  • fpath (Union[str, pathlib.Path]) – path to the archive/dataset.

  • sha256_provided (str) – the SHA256 sum to be checked.

  • chunk_size (Optional[int]) – the file is binary read in chunks to not load it fully to memory. This is the size of each chunk.

Return type:

str