linear.pyi 1.32 KB
Newer Older
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
1
2
3
4
5
6
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.

from .module import Module
from .. import Parameter
from ... import Tensor

Min Xu's avatar
Min Xu committed
7
8
9
import torch
from typing import Union

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

class Identity(Module):

    def __init__(self) -> None: ...

    def forward(self, input: Tensor) -> Tensor: ...  # type: ignore

    def __call__(self, input: Tensor) -> Tensor: ...  # type: ignore


class Linear(Module):
    in_features: int = ...
    out_features: int = ...
    weight: Parameter = ...
    bias: Parameter = ...

Min Xu's avatar
Min Xu committed
26
    def __init__(self, in_features: int, out_features: int, bias: bool = ..., device:str = ..., dtype:Union[str, torch.dtype] = ...) -> None: ...
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

    def reset_parameters(self) -> None: ...

    def forward(self, input: Tensor) -> Tensor: ...  # type: ignore

    def __call__(self, input: Tensor) -> Tensor: ...  # type: ignore


class Bilinear(Module):
    in1_features: int = ...
    in2_features: int = ...
    out_features: int = ...
    weight: Parameter = ...
    bias: Parameter = ...

    def __init__(self, in1_features: int, in2_features: int, out_features: int, bias: bool = ...) -> None: ...

    def reset_parameters(self) -> None: ...

    def forward(self, input1: Tensor, input2: Tensor) -> Tensor: ...  # type: ignore

    def __call__(self, input1: Tensor, input2: Tensor) -> Tensor: ...  # type: ignore