In python, if I want to realize a custom ops which is extended by autograd.Function, I may code as following. The idx’s grad is not need for updating.

```
class MyOps(torch.autograd.Function):
@staticmethod
def forward(ctx, features: torch.Tensor, idx: torch.Tensor) -> torch.Tensor:
# some operations, and output is a Tensor
......
return output
def backward(ctx, grad_out) :
# some operations, and idx's grad is not needed for updating.
......
return features_grad, None
```

In C++ API(libotrch), I code as follwing:

```
using namespace torch::autograd;
class MyOps : public Function<MyOps> {
public:
static torch::Tensor forward(AutogradContext *ctx, torch::Tensor features, torch::Tensor idx) {
# some operations, and output is a Tensor
return output;
}
}
```

The problem is, I don’t know how to return None and define the return type in backward.

I have read the C++ API and find a value named c10::nullopt. Is that equal to None in Python?

Could anybody give me a backward example?

Thanks.