Rate This Document
Findability
Accuracy
Completeness
Readability

Less

Function

Compare two input tensors and return a Boolean tensor element by element, indicating whether the first input tensor is less than the second one.

Prototype

1
2
3
4
5
int Less(T *input0, T *input1, bool *output, size_t length);       // input0 and input1 are pointer variables.

int Less(T *input0, T *input1, bool *output, size_t length);       // input0 is a pointer variable.

int Less(T *input0, T *input1, bool *output, size_t length);       // input1 is a pointer variable.
  • This API accepts only 1D tensors as inputs.
  • Template type T: int64_t and int32_t are supported.
  • The valid length of the pointer is determined by the user.
  • Ensure that the valid spaces of the input pointers do not overlap.

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

Constraint

input0

Input

Tensor to be compared.

This pointer is not null and only 1D tensors are accepted. Scalars are accepted, but input0 cannot be a scalar together with input1.

input1

Input

Tensor used for comparison.

This pointer is not null and only 1D tensors are accepted. Scalars are accepted, but input1 cannot be a scalar together with input0.

output

Input

Tensor used to store the comparison results as the output.

This pointer is not null and only 1D tensors are accepted.

length

Input

Length of the tensor used for calculation.

The value range is [0, 2^64 – 1]. The length value is equal to the minimum value of the valid space of output, input0, or input1. The value must be checked by the user to prevent security issues such as buffer overflow.