parameter.pyi 639 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
4
5
from typing import Optional
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
17
    # 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]

18
19
    def __new__(cls, data: Tensor, requires_grad: builtins.bool = True): ...

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

    ...