include_traditionalml_kernels.h#
-
namespace ONNX_LIGHT_NAMESPACE
-
namespace onnx_backend_test
-
namespace kernel
-
class Binarizer#
- #include <include_traditionalml_kernels.h>
Reference implementation of the
ai.onnx.mlBinarizeroperator (since opset 1 in theai.onnx.mldomain).For every input element
x[i], the output elementy[i]is1ifx[i] > thresholdand0otherwise. The output tensor has the same shape and element type as the input.The kernel supports the four numeric element types listed in the ONNX schema via explicit template instantiations:
floatdoubleint64_tint32_t
The in-place overload throws
std::invalid_argumentif the preallocated output’s dtype/shape/byte size do not match the input’s.Public Functions
-
inline explicit Binarizer(const KernelContext &ctx)#
Public Static Functions
-
static inline constexpr bool CanRunInPlace() noexcept#
Private Members
-
KernelContext ctx_#
-
class LabelEncoder#
- #include <include_traditionalml_kernels.h>
Maps each element of the input tensor through a pair of parallel
keys/valuesarrays — the reference behaviour of theai.onnx.mlLabelEncoderoperator (since opset 4 in theai.onnx.mldomain).For every input element
x[i], the output elementy[i]isvalues[k]wherekis the index of the firstkeys[k]that matchesx[i]; if no key matches,y[i]isdefault_value.The output tensor has the same shape as the input tensor. The kernel supports the following
(KeyT, ValueT)element-type combinations via explicit template instantiations:(int64_t, int64_t)(int64_t, float)(float, int64_t)(float, float)
keys.size()must matchvalues.size(). The kernel throwsstd::invalid_argumentif the input element type does not matchKeyTor, for the in-place overload, if the preallocated output’s type/shape do not match the resolved value type and the input shape.Public Functions
-
inline explicit LabelEncoder(const KernelContext &ctx)#
Public Static Functions
-
static inline constexpr bool CanRunInPlace() noexcept#
Private Members
-
KernelContext ctx_#
-
class Binarizer#
-
namespace kernel
-
namespace onnx_backend_test