def METHOD_NAME(input, variant):
    dtype = torch.float
    int_type = torch.int
    mask = MASK[variant]
    mask_round = MASK_ROUND[variant]
    excessive_bits = torch.tensor(21, dtype=int_type)
    signs = torch.where(input < 0.0, -1.0, 1.0).to(dtype)
    asInt = torch.bitwise_and(input.view(int_type), 2147483647)
    mant_odd = torch.bitwise_and(
        torch.bitwise_right_shift(asInt, excessive_bits),
        torch.tensor(1, dtype=int_type),
    )
    asInt_masked = asInt + mask_round
    asInt_odded = asInt_masked + mant_odd
    masked = torch.bitwise_and(asInt_odded, mask)
    return masked.view(dtype) * signs