I think “signed float” is the source of your trouble, OpenCV’s types are Unsigned ints, Signed ints and Floats of various precision.
So using torch::kLong for the from_blob would seem to be the natural way. You’d run into trouble for CV_8S because PyTorch doesn’t have them, but here, just avoid the kByte that corresponds to CV_8U.
Best regards
Thomas