parameter.pyi 718 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
12
13
14
15
16
    # These are dynamic attributes added by shard_params_data_parallel class.
    # Added here for better type checking.
    _is_sharded: bool
    _orig_size: Size
    _cpu_grad: Tensor
    _full_param_padded: Tensor
    _fp32_shard: Tensor
    _fp16_shard: Optional[Tensor]
17
    _shard_bwd_hook: Tuple[Any, Any]
18
    _saved_grad_shard: Tensor
19

20
21
    def __new__(cls, data: Tensor, requires_grad: builtins.bool = True): ...

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

    ...