Would this be the correct way of using the guard?
int n_features = feature_list.size();

    torch::Tensor state_tensor = torch::ones({n_features}, torch::requires_grad(requires_grad));
    
    {
        NoGradGuard guard;
        for (int i = 0; i < n_features; i ++)
        {
            state_tensor[i] = feature_list[i].value;
        }
    }

    state_tensor.set

    return state_tensor;