Directly apply the kraus operators to the target tensor.

def _apply_krauss(krauss: Union[Tuple[np.ndarray], Sequence[Any]],
        args: 'ApplyChannelArgs') -> np.ndarray:
    """Directly apply the kraus operators to the target tensor."""
    # Initialize output.
    args.out_buffer[:] = 0
    # Stash initial state into buffer0.
    np.copyto(dst=args.auxiliary_buffer0, src=args.target_tensor)

    # Special case for single-qubit operations.
    if krauss[0].shape == (2, 2):
        return _apply_krauss_single_qubit(krauss, args)
    # Fallback to np.einsum for the general case.
    return _apply_krauss_multi_qubit(krauss, args)