parameter.pyi 768 Bytes
Newer Older
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
1
2
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.

3
from typing import Optional, Tuple, Any
4
5
from .. import Size, Tensor
from ..cuda import Stream
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
6
7
8
import builtins

class Parameter(Tensor):
9
10
11
    # These are dynamic attributes added by shard_params_data_parallel class.
    # Added here for better type checking.
    _is_sharded: bool
12
    _is_shared: bool
13
14
15
16
17
    _orig_size: Size
    _cpu_grad: Tensor
    _full_param_padded: Tensor
    _fp32_shard: Tensor
    _fp16_shard: Optional[Tensor]
18
    _shard_bwd_hook: Tuple[Any, Any]
19
    _saved_grad_shard: Tensor
20
    _linked_param: Parameter
21

22
23
    def __new__(cls, data: Tensor, requires_grad: builtins.bool = True): ...

Tom Birch's avatar
Tom Birch committed
24
    def __init__(self, data: Tensor, requires_grad: builtins.bool = True): ...
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
25
26

    ...