| pth_catalogue | R Documentation |
Reads the metadata of a .pth file — the tensor names, shapes and
dtypes — without reading the tensors. A checkpoint is a zip holding one
pickle of metadata and one entry per tensor, so the catalogue is cheap
whatever the file weighs.
pth_catalogue(path)
path |
Path to a |
What comes back is the checkpoint's own state_dict order, which is
the order the model's modules were built in.
A data.frame with one row per tensor and the columns name,
shape (as "a x b"), dtype, n (element count),
bytes, and entry (the zip entry holding the data).
The attribute "file" carries the path.
## Not run:
cat <- pth_catalogue("model.pth")
head(cat)
sum(cat$n) # total parameters
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.