Check if `x` is a valid member of the space. .. note:: This method checks if `x` is a valid member of the space. Use :meth:`.ModuleSpace.normalized.contains` to check if a value is a member of the normalized space. Parameters ----------
(self, x)
| 137 | _spread: Union[np.ndarray, dict] |
| 138 | |
| 139 | def contains(self, x): |
| 140 | """ |
| 141 | Check if `x` is a valid member of the space. |
| 142 | |
| 143 | .. note:: |
| 144 | This method checks if `x` is a valid member of the space. Use :meth:`.ModuleSpace.normalized.contains` to |
| 145 | check if a value is a member of the normalized space. |
| 146 | |
| 147 | Parameters |
| 148 | ---------- |
| 149 | x : scalar or array-like |
| 150 | Value to check membership. |
| 151 | |
| 152 | Returns |
| 153 | ------- |
| 154 | containment : bool |
| 155 | Whether `x` is a valid member of the space. |
| 156 | |
| 157 | """ |
| 158 | return x in self._unnormalized |
| 159 | |
| 160 | def sample(self, normalized=False): |
| 161 | if normalized: |