if weights.ndim == 3:
        dz, dy, dx = weights.shape
        if (dz == 0) or (dy == 0) or (dx == 0):
            msg = "The length of one of dimensions is equal to zero"
            raise ValueError(msg)