10000 Issue when working with type annotation in Python mode · Issue #4 · emacs-vs/docstr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Issue when working with type annotation in Python mode #4
Open
@failable

Description

@failable

The auto generated docstring has some issues with type hintings in Python mode. The type of the first argument is generated as [type] and the types of the following arguments seems shifted:

def forward(
    self,
    input_ids: torch.LongTensor,
    position_ids: torch.LongTensor,
    token_type_ids: torch.LongTensor,
) -> torch.FloatTensor:
    """[summary]

    Args:
        input_ids ([type]): [description]
        position_ids (torch.LongTensor): [description]
        token_type_ids (torch.LongTensor): [description]
         (torch.LongTensor): [description] 

    Returns:
        torch.FloatTensor: [description]
    """
    input_embeddings = self.word_embeddings(input_ids)
    position_embeddings = self.position_embeddings(position_ids)
    token_type_embeddings = self.token_type_embeddings(token_type_ids)

    embeddings = input_embeddings + token_type_embeddings + position_embeddings
    embeddings = self.layer_norm(embeddings)
    embeddings = self.dropout(embeddings)

    return embeddings

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0