Add(3)(5) nn.Sequential. How it works?
class Add(nn.Module):
    def __init__(self, value):
        super().__init__()
        self.value = value

    def forward(self, x):
        return x + self.value

calculator = nn.Sequential(
    Add(3),
    Add(2),
    Add(5),
)


x = torch.tensor([1])
output = calculator(x)
print(output) # tensor([11])

I made Add Model. but I can't understand how 'nn.Sequential' works.
at the firsttime, I understood like this
add = Add(torch.tensor([1]))
add(3) # tensor([4])
add = Add(add(3))
add(2) # tensor([6])
add = Add(add(2))
add(5) # tensor([11])

but Add(3)(1) also works.
I can't understand why 'Add(3)(1)' works. help me plz

You understand it right, the Sequential class in a nutshell just calls provided modules one by one. Here's the code of the forward method
    def forward(self, input):
        for module in self:
            input = module(input)
        return input

here, for module in self just iterates through the modules provided in a constructor (Sequential.__iter__ method in charge of it).
Sequential module calls this method when you call it using () syntax.
calculator = nn.Sequential(
    Add(3),
    Add(2),
    Add(5),
)
output = calculator(torch.tensor([1]))

But how does it work? In python, you could make objects of a class callable, if you add __call__ method to the class definition. If the class does not contain this method explicitly, it means that it possibly was inherited from a superclass. In case of Add and Sequential, it's Module class that implements __call__ method. And __call__ method calls 'public' forward method defined by a user.
It could be confusing that python uses the same syntax for the object instantiation and function or method call. To make a difference visible to the reader, python uses naming conventions. Classes should be named in a CamelCase with a first capital letter, and objects in a snake_case (it's not obligatory, but it's the rule that better to follow).
Just like in you example, Add is a class and add is a callable object of this class:
add = Add(torch.tensor([1]))

So, you can call add just like you have called a calculator in you example.
&gt;&gt;&gt; add = Add(torch.tensor([1]))
&gt;&gt;&gt; add(2)
Out: tensor([3]) 

But that won't work:
&gt;&gt;&gt; add = Add(torch.tensor([1]))
&gt;&gt;&gt; add(2)(1)
Out: 
----&gt; 3 add(2)(1)
TypeError: 'Tensor' object is not callable

That means that add(2) returns a Tensor object that does not implement __call__ method.
Compare this code with
&gt;&gt;&gt; Add(torch.tensor([1]))(2)
Out:
tensor([3])  

This code is the same as the first example, but rearranged a little bit.
--
To avoid confusion, I usually name objects differently: like add_obj = Add(1). It helps me to highlight a difference.
If you are not sure what you're working with, use functions type and isinstance. They would help to find out what's going on.
For example, if you check the add object, you could see that it's a callable object (i.e., it implements __call__)
&gt;&gt;&gt; from typing import Callable
&gt;&gt;&gt; isinstance(add, Callable)
True

And for a tensor:
&gt;&gt;&gt; from typing import Callable
&gt;&gt;&gt; isinstance(add, torch.tensor(1))
False

Hence, it will rase TypeError: 'Tensor' object is not callable in case you call it.
If you'd like to understand how python double-under methods like init or call work, you could read this page that describes python data model
(It could be a bit tedious, so you could prefer to read something like Fluent Python or other book)
