Tensor.conj() for python tensor and then operation in c++ api

Tensor.conj() applied in python3 was not applied when operation in c++. I would like to know how to properly use this in C++ operations.

I want to implement it as general as possible, so I want to solve it without the user using conj_physical instead of conj or additionally calling resolve_conj in the code.

part of the code:

conj_physical
python3:

A = (...).conj_physical()
print(A.flatten()[1], torch.tensor(1+1j))
# tensor(-0.2042-0.5812j, grad_fn=<SelectBackward0>) tensor(1.+1.j)
print(A.flatten()[1]*torch.tensor(1+1j))
# tensor(0.3770-0.7854j, grad_fn=<MulBackward0>)
cpp_ext(A)

c++

void foo(at::Tensor A) {
    std::cout<<A.accessor<c10::complex<float>,4>()[0][0][0][1]<<c10::complex<float>(1., 1.)<<A.accessor<c10::complex<float>,4>()[0][0][0][1]*c10::complex<float>(1., 1.)<<std::endl;
// (-0.204194,-0.581166)(1,1)(0.376973,-0.78536)
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("cpp_ext", &foo, "ext");
}

conj
python3:

A = (...).conj()
print(A.flatten()[1], torch.tensor(1+1j))
# tensor(0.0257+0.6646j, grad_fn=<SelectBackward0>) tensor(1.+1.j)
print(A.flatten()[1]*torch.tensor(1+1j))
# tensor(-0.6389+0.6903j, grad_fn=<MulBackward0>)
cpp_ext(A)

c++

void foo(at::Tensor A) {
    std::cout<<A.accessor<c10::complex<float>,4>()[0][0][0][1]<<c10::complex<float>(1., 1.)<<A.accessor<c10::complex<float>,4>()[0][0][0][1]*c10::complex<float>(1., 1.)<<std::endl;
// (0.0257227,-0.664579)(1,1)(0.690302,-0.638856)
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("cpp_ext", &foo, "ext");
}