Copy array to cuda tensor

Hello I am trying to copy the boolean vector into pytorch tensor and generate appropriate accessor Hovewer I get some error that I do not understand

    bool* onlyBladderBoolFlat;
//... populating onlyBladderBoolFlat with data - it works well
    auto options = torch::TensorOptions().dtype(torch::kBool).device(torch::kCUDA, 1);
    torch::PackedTensorAccessor32<bool, 1, torch::RestrictPtrTraits> onlyBladderBoolFlatTensor = torch::from_blob(onlyBladderBoolFlat, { lengg }, options)
        .packed_accessor32<bool, 1, torch::RestrictPtrTraits>();

give error

configuration details

torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113
Python 3.6