src/orion/core/worker/transformer.py
def transform(self, point):
        """Match a `point` containing integers to real vector representations of them.

        If the upper bound of integers supported by an instance of `OneHotEncode`
        is less or equal to 2, then cast them to floats.

        .. note:: This transformation possibly appends one more tensor dimension to `point`.
        """
        point_ = numpy.asarray(point)
        assert (
            numpy.all(point_ < self.num_cats)
            and numpy.all(point_ >= 0)
            and numpy.all(point_ % 1 == 0)
        )

        if self.num_cats <= 2:
            return numpy.asarray(point_, dtype=float)

        hot = numpy.zeros(self.infer_target_shape(point_.shape))
        grid = numpy.meshgrid(
            *[numpy.arange(dim) for dim in point_.shape], indexing="ij"
        )
        hot[grid + [point_]] = 1
        return hot
Match a `point` containing integers to real vector representations of them.

        If the upper bound of integers supported by an instance of `OneHotEncode`
        is less or equal to 2, then cast them to floats.

        .. note:: This transformation possibly appends one more tensor dimension to `point`.
        
Match a `point` containing integers to real vector representations of them.
If the upper bound of integers supported by an instance of `OneHotEncode`
is less or equal to 2, then cast them to floats.

: This transformation possibly appends one more tensor dimension to `point`.
Match a ` point ` containing integers to real vector representations of them . If the upper bound of integers supported by an instance of ` OneHotEncode ` is less or equal to 2 then cast them to floats . : This transformation possibly appends one more tensor dimension to ` point ` .
def transform(self, point):
        point_ = numpy.asarray(point)
        assert (
            numpy.all(point_ < self.num_cats)
            and numpy.all(point_ >= 0)
            and numpy.all(point_ % 1 == 0)
        )
        if self.num_cats <= 2:
            return numpy.asarray(point_, dtype=float)
        hot = numpy.zeros(self.infer_target_shape(point_.shape))
        grid = numpy.meshgrid(
            *[numpy.arange(dim) for dim in point_.shape], indexing="ij"
        )
        hot[grid + [point_]] = 1
        return hot
def transform ( self , point ) : point_ = numpy . asarray ( point ) assert ( numpy . all ( point_ < self . num_cats ) and numpy . all ( point_ >= 0 ) and numpy . all ( point_ % 1 == 0 ) ) if self . num_cats <= 2 : return numpy . asarray ( point_ , dtype = float ) hot = numpy . zeros ( self . infer_target_shape ( point_ . shape ) ) grid = numpy . meshgrid ( * [ numpy . arange ( dim ) for dim in point_ . shape ] , indexing = "ij" ) hot [ grid + [ point_ ] ] = 1 return hot
Match a `point` containing integers to real vector representations of them.
Match a ` point ` containing integers to real vector representations of them .
"""Match a `point` containing integers to real vector representations of them.

        If the upper bound of integers supported by an instance of `OneHotEncode`
        is less or equal to 2, then cast them to floats.

        .. note:: This transformation possibly appends one more tensor dimension to `point`.
        """
self
point