I am getting a Thread 1: EXC_BAD_ACCESS error in the torch::jit::Module::forward call here
  IValue forward(std::vector<IValue> inputs) {
    // get_method("forward") returns but calling (std::move(inputs)) after 
    // results in Thread 1: EXC_BAD_ACCESS
    return get_method("forward")(std::move(inputs)); 
  }

The code before calling the function is from here which follows closely to that of the D2Go’s github object detection repo 1
        at::Tensor tensor = torch::from_blob(imageBuffer, { 3, input_width, input_height }, at::kFloat);
        torch::autograd::AutoGradMode guard(false);
        at::AutoNonVariableTypeMode non_var_type_mode(true);
        
        std::vector<torch::Tensor> v;
        v.push_back(tensor);
        std::vector<at::IValue> b = {at::TensorList(v)};
        auto outputTuple = _impl.forward(b).toTuple(); // error 

Might anyone have any intuition why this might happen ? For context, I am calling this function in swift UI on the main thread.