mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
multiple docs
This commit is contained in:
committed by
Soumith Chintala
parent
82ef292f00
commit
6ee6b4980b
@ -15,26 +15,26 @@ storage_classes = [
|
||||
]
|
||||
|
||||
|
||||
def add_docstr_all(classes, method, docstr):
|
||||
for cls_name in classes:
|
||||
def add_docstr_all(method, docstr):
|
||||
for cls_name in storage_classes:
|
||||
cls = getattr(torch._C, cls_name)
|
||||
add_docstr(getattr(cls, method),
|
||||
docstr.format(
|
||||
cls_name.replace('Base', ''),
|
||||
cls_name.replace('StorageBase', '')))
|
||||
try:
|
||||
add_docstr(getattr(cls, method), docstr)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
|
||||
add_docstr_all(storage_classes, 'from_file',
|
||||
add_docstr_all('from_file',
|
||||
"""
|
||||
from_file(filename, shared=False, size=0) -> {0}
|
||||
from_file(filename, shared=False, size=0) -> Storage
|
||||
|
||||
If shared is True then memory is shared between all processes. All changes are
|
||||
written to the file. If shared is False then the changes on the storage do not
|
||||
affect the file.
|
||||
|
||||
Size is the number of elements in the storage. If shared is False then the file
|
||||
must contain at least `size * sizeof({1})` bytes. If shared is True the file
|
||||
will be created if needed.
|
||||
must contain at least `size * sizeof(Type)` bytes (`Type` is the type of storage).
|
||||
If shared is True the file will be created if needed.
|
||||
|
||||
Args:
|
||||
filename (str): file name to map
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user