8000 `CELU()`'s `alpha` argument with `int`, `complex` or `bool` and `inplace` argument with `int`, `complex` and `float` work against the doc · Issue #133573 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
CELU()'s alpha argument with int, complex or bool and inplace argument with int, complex and float work against the doc #133573
Closed
@hyperkai

Description

@hyperkai

🐛 Describe the bug

The doc of CELU() says the types of alpha and inplace argument are float and bool respectively as shown below:

  • alpha (float) – the α value for the CELU formulation. Default: 1.0
  • inplace (bool) – can optionally do the operation in-place. Default: False

But alpha argument with int, complex or bool and inplace argument with int, complex and float work against the doc as shown below:

import torch
from torch import nn

my_tensor = torch.tensor([-1., 0., 1.])
celu = nn.CELU(alpha=1, inplace=1)
celu(input=my_tensor)
# tensor([-0.6321,  0.0000,  1.0000])

my_tensor = torch.tensor([-1., 0., 1.])
celu = nn.CELU(alpha=1.+0.j, inplace=1.+0.j)
celu(input=my_tensor)
# tensor([-0.6321,  0.0000,  1.0000])

my_tensor = torch.tensor([-1., 0., 1.])
celu = nn.CELU(alpha=True, inplace=1.)
celu(input=my_tensor)
# tensor([-0.6321,  0.0000,  1.0000])

Versions

import torch

torch.__version__ # 2.3.1+cu121

cc @svekars @sekyondaMeta @AlannaBurke @albanD @brycebortree

Metadata

Metadata

Assignees

Labels

docathon-h1-2025mediumLabel for medium docathon tasksmodule: docsRelated to our documentation, both in docs/ and docblocksmodule: python frontendFor issues relating to PyTorch's Python frontendtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0