MCPcopy Create free account
hub / github.com/openai/point-e / validate

Method validate

point_e/evals/npz_stream.py:59–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 return self.shape[1:]
58
59 def validate(self):
60 if self.name in {"R", "G", "B"}:
61 if len(self.shape) != 2:
62 raise ValueError(
63 f"expecting exactly 2-D shape for '{self.name}' but got: {self.shape}"
64 )
65 elif self.name == "arr_0":
66 if len(self.shape) < 2:
67 raise ValueError(f"expecting at least 2-D shape but got: {self.shape}")
68 elif len(self.shape) == 3:
69 # For audio, we require continuous samples.
70 if not np.issubdtype(self.dtype, np.floating):
71 raise ValueError(
72 f"invalid dtype for audio batch: {self.dtype} (expected float)"
73 )
74 elif self.dtype != np.uint8:
75 raise ValueError(f"invalid dtype for image batch: {self.dtype} (expected uint8)")
76
77
78class NpzStreamer:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected