def validate()

in point_e/evals/npz_stream.py [0:0]


    def validate(self):
        if self.name in {"R", "G", "B"}:
            if len(self.shape) != 2:
                raise ValueError(
                    f"expecting exactly 2-D shape for '{self.name}' but got: {self.shape}"
                )
        elif self.name == "arr_0":
            if len(self.shape) < 2:
                raise ValueError(f"expecting at least 2-D shape but got: {self.shape}")
            elif len(self.shape) == 3:
                # For audio, we require continuous samples.
                if not np.issubdtype(self.dtype, np.floating):
                    raise ValueError(
                        f"invalid dtype for audio batch: {self.dtype} (expected float)"
                    )
            elif self.dtype != np.uint8:
                raise ValueError(f"invalid dtype for image batch: {self.dtype} (expected uint8)")