<commit_before># AUTOGENERATED! DO NOT EDIT! File to edit: nbs/99_pytorch_doc.ipynb (unless otherwise specified).

__all__ = ['PYTORCH_URL', 'pytorch_doc_link']

# Cell
from types import ModuleType

# Cell
PYTORCH_URL = 'https://pytorch.org/docs/stable/'

# Cell
def _mod2page(
    mod:ModuleType, # A pytorch module
) -> str :
    "Get the web page name for a pytorch module"
    if mod == Tensor: return 'tensors.html'
    name = mod.__name__
    name = name.replace('torch.', '').replace('utils.', '')
    if name.startswith('nn.modules'): return 'nn.html'
    return f'{name}.html'

# Cell
import importlib

# Cell
def pytorch_doc_link(
    name:str, # Name of a pytorch module, class or function
) -> (str, None):<commit_msg>Update fastai/_pytorch_doc.py<commit_after># AUTOGENERATED! DO NOT EDIT! File to edit: nbs/99_pytorch_doc.ipynb (unless otherwise specified).

__all__ = ['PYTORCH_URL', 'pytorch_doc_link']

# Cell
from types import ModuleType

# Cell
PYTORCH_URL = 'https://pytorch.org/docs/stable/'

# Cell
def _mod2page(
    mod:ModuleType, # A pytorch module
) -> str:
    "Get the web page name for a pytorch module"
    if mod == Tensor: return 'tensors.html'
    name = mod.__name__
    name = name.replace('torch.', '').replace('utils.', '')
    if name.startswith('nn.modules'): return 'nn.html'
    return f'{name}.html'

# Cell
import importlib

# Cell
def pytorch_doc_link(
    name:str, # Name of a pytorch module, class or function
) -> (str, None):
{'fraction_non_alphanumeric': 0.13559322033898305, 'fraction_numerical': 0.004067796610169492, 'mean_word_length': 3.903654485049834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1839664', 'n_tokens_mistral': 534, 'n_tokens_neox': 541, 'n_words': 146}