@Esmaeil_Farhang The equivalent of

input_data = torch.nn.functional.pad( input_data.unsqueeze(1), (2,2, 0, 0), mode=‘reflect’)

is

auto input_data = torch::nn::functional::pad( input_data.unsqueeze(1), torch::nn::functional::PadFuncOptions({2,2, 0, 0}).mode(torch::kReflect))

To debug the runtime error, it’s best to run the equivalent script in Python first and make sure it works, and then translate it to C++ code.