include_logical_kernels.h#

namespace onnx_light

Alias that makes onnx-light headers compatible with code that references ONNX_LIGHT_NAMESPACE (the macro used in the standard onnx package).

Set to ONNX_LIGHT_NAMESPACE so both names resolve to the same namespace.

Symbol-visibility attribute for the public onnx-light C++ API.

Defined as empty because onnx-light does not require explicit __declspec(dllexport) or __attribute__((visibility("default"))) annotations — visibility is controlled at the shared-library level. The macro is provided so that vendored ONNX headers that decorate their declarations with ONNX_API compile without modification.

Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal onnx namespace — rather than the ONNX_NAMESPACE macro — resolves to the onnx-light namespace. The standard onnx package lives in namespace onnx; onnx-light uses onnx_light (via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs from onnx.

namespace onnx_kernels
namespace kernel
class And : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise logical AND on BOOL tensors with multidirectional broadcasting.

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class BitShift : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise BitShift on unsigned integer tensors (opset 11). Both inputs must share the same dtype (UINT8, UINT16, UINT32 or UINT64); the output has the same dtype. Multidirectional (Numpy-style) broadcasting is supported. The required direction attribute selects "LEFT" or "RIGHT" and is passed to operator(). Mirrors the upstream np.left_shift / np.right_shift reference implementations.

Public Types

enum class Direction#

Direction of the bitwise shift.

Values:

enumerator kLeft#
enumerator kRight#

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y, Direction direction) const#
void operator()(const Tensor &x, const Tensor &y, Direction direction, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class BitwiseAnd : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise bitwise AND on integer tensors with multidirectional broadcasting (opset 18). Inputs may be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output has the same dtype. Mirrors the upstream ONNX BitwiseAnd reference implementation (np.bitwise_and).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class BitwiseNot : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise bitwise NOT on integer tensors (opset 18). Input may be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64; the output has the same dtype and shape. Mirrors the upstream ONNX BitwiseNot reference implementation (np.bitwise_not).

Public Functions

Tensor operator()(const Tensor &x) const#
void operator()(const Tensor &x, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class BitwiseOr : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise bitwise OR on integer tensors with multidirectional broadcasting (opset 18). Inputs may be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output has the same dtype. Mirrors the upstream ONNX BitwiseOr reference implementation (np.bitwise_or).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class BitwiseXor : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise bitwise XOR on integer tensors with multidirectional broadcasting (opset 18). Inputs may be INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output has the same dtype. Mirrors the upstream ONNX BitwiseXor reference implementation (np.bitwise_xor).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Equal : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise Equal comparison with multidirectional broadcasting. Inputs may be BOOL, FLOAT, DOUBLE, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 or STRING (both inputs must share the same dtype); the output is BOOL (one byte per element, 0 or 1). Mirrors the upstream ONNX Equal reference implementation (np.equal). STRING support matches the Equal opset 19 type expansion and is restricted to equal-shape inputs or scalar broadcasting.

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Greater : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise Greater comparison with multidirectional broadcasting. Inputs may be FLOAT, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output is BOOL (one byte per element, 0 or 1). Mirrors the upstream ONNX Greater reference implementation (np.greater).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class GreaterOrEqual : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise GreaterOrEqual comparison with multidirectional broadcasting. Inputs may be FLOAT, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output is BOOL (one byte per element, 0 or 1). Mirrors the upstream ONNX GreaterOrEqual reference implementation (np.greater_equal).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class IsInf : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise IsInf: returns a BOOL tensor with the same shape as the input, where each element is true iff the corresponding input value is +/- infinity. The two boolean attributes detect_positive and detect_negative (both default to 1) toggle whether +inf and -inf are reported respectively. Mirrors the upstream ONNX IsInf reference implementation (np.isinf / np.isposinf / np.isneginf). Only the FLOAT input dtype is supported.

Public Functions

Tensor operator()(const Tensor &x, int64_t detect_positive = 1, int64_t detect_negative = 1) const#
void operator()(const Tensor &x, int64_t detect_positive, int64_t detect_negative, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#

Input is FLOAT (4 bytes/elt) and output is BOOL (1 byte/elt), so the output buffer cannot alias the input buffer.

class IsNaN : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise IsNaN: returns a BOOL tensor with the same shape as the input, where each element is true iff the corresponding input value is NaN. Mirrors the upstream ONNX IsNaN reference implementation (np.isnan). Supports FLOAT, DOUBLE, FLOAT16 and BFLOAT16 inputs.

Public Functions

Tensor operator()(const Tensor &x) const#
void operator()(const Tensor &x, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#

Input is FLOAT (4 bytes/elt) and output is BOOL (1 byte/elt), so the output buffer cannot alias the input buffer.

class Less : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise Less comparison with multidirectional broadcasting. Inputs may be FLOAT, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output is BOOL (one byte per element, 0 or 1). Mirrors the upstream ONNX Less reference implementation (np.less).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class LessOrEqual : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise LessOrEqual comparison with multidirectional broadcasting. Inputs may be FLOAT, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32 or UINT64 (both inputs must share the same dtype); the output is BOOL (one byte per element, 0 or 1). Mirrors the upstream ONNX LessOrEqual reference implementation (np.less_equal).

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Not : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise logical NOT on a BOOL tensor (opset 1). The output has the same BOOL dtype and shape as the input. Mirrors the upstream ONNX Not reference implementation (np.logical_not).

Public Functions

Tensor operator()(const Tensor &x) const#
void operator()(const Tensor &x, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Or : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise logical OR on BOOL tensors with multidirectional broadcasting.

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Where : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise Where selection with multidirectional broadcasting. condition must be BOOL; x and y must share the same dtype and may be BOOL, FLOAT, DOUBLE, INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 or STRING. Output dtype equals x/y dtype.

Public Functions

Tensor operator()(const Tensor &condition, const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &condition, const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#
class Xor : public onnx_light::onnx_kernels::kernel::KernelBase#
#include <include_logical_kernels.h>

Element-wise logical XOR on BOOL tensors with multidirectional broadcasting.

Public Functions

Tensor operator()(const Tensor &x, const Tensor &y) const#
void operator()(const Tensor &x, const Tensor &y, Tensor &output) const#
inline explicit KernelBase(const KernelContext &ctx)#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#