function ORT\Math\add(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\subtract(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\multiply(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\divide(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\mod(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\neg(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\recip(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\abs(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\sign(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\exp(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\exp2(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\log(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\log2(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\log10(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\pow(ORT\Tensor $tensor_a, ORT\Tensor|int|float $tensor_b_or_scalar): ORT\Tensor
function ORT\Math\sqrt(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\cbrt(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\sin(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\cos(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\tan(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\asin(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\acos(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\atan(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arcsin(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arccos(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arctan(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\sinh(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\cosh(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\tanh(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arcsinh(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arccosh(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\arctanh(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\ceil(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\floor(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\round(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\trunc(ORT\Tensor $tensor): ORT\TensorOperations that reduce tensor dimensions by aggregating values.
function ORT\Math\reduce\tensor\min(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\reduce\tensor\max(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\reduce\tensor\mean(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\reduce\tensor\sum(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\reduce\tensor\argmax(ORT\Tensor $tensor): ORT\Tensor
function ORT\Math\reduce\tensor\argmin(ORT\Tensor $tensor): ORT\Tensorfunction ORT\Math\reduce\axis\min(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensor
function ORT\Math\reduce\axis\max(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensor
function ORT\Math\reduce\axis\mean(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensor
function ORT\Math\reduce\axis\sum(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensor
function ORT\Math\reduce\axis\argmax(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensor
function ORT\Math\reduce\axis\argmin(ORT\Tensor $tensor, int $axis, bool $keepdims = false): ORT\Tensorfunction ORT\Math\reduce\dot(ORT\Tensor $tensor_a, ?ORT\Tensor $tensor_b = null): ORT\TensorOperations that transform tensor values along an axis.
function ORT\Math\transform\axis\softmax(ORT\Tensor $tensor, int $axis): ORT\Tensorfunction ORT\Math\matmul(ORT\Tensor $matrix_a, ORT\Tensor $matrix_b): ORT\Tensorfunction ORT\Math\cast(int $type, ORT\Tensor $tensor): ORT\Tensor/**
* Set scaling parameters
* @param cores
* @param code
* @param threshold
**/
function ORT\Math\scale(int $cores, callable $code, int $threshold = 0): mixed
/**
* Get scaling parameter: cores
* @param max where true, will return the maximum cores available
**/
function ORT\Math\scale\cores(bool $max = false): int
/**
* Get scaling parameter: threshold
* @param default where true, will return the default threshold
**/
function ORT\Math\scale\threshold(bool $default = false): intfunction ORT\Math\backend(): array|false
function ORT\Math\backend\cpu(): string|false
function ORT\Math\backend\gpu(): string|falseclass ORT\Math\Schema {
const int BINARY = 1;
const int UNARY = 2;
public function __construct(string $symbol);
public function getSymbol(): ?string;
public function getKind(): int;
public function resolve(...$types): int;
}interface ORT\Tensor {
const int UNDEFINED;
const int FLOAT16;
const int FLOAT32;
const int FLOAT64;
const int UINT8;
const int INT8;
const int UINT16;
const int INT16;
const int UINT32;
const int INT32;
const int INT64;
const int BOOL;
public function isPersistent(): bool;
public function getName(): ?string;
public function getType(): int;
public function getTypeName(): string;
public function getShape(): array;
public function getSlice(array $start, array $end, array $axis = []): ORT\Tensor;
public function getData(int $offset = 0, int $depth = 0): array;
public function transpose(?array $axis = null): ORT\Tensor;
}class ORT\Tensor\Persistent implements ORT\Tensor {
public function __construct(
string $name,
array $shape = [],
object|array $data = [],
int $type = ORT\Tensor::FLOAT32
);
public static function from(string $name, array $data, int $type): ORT\Tensor;
}class ORT\Tensor\Transient implements ORT\Tensor {
public function __construct(
array $shape,
object|array $data,
int $type = ORT\Tensor::FLOAT32
);
public static function from(array $data, int $type): ORT\Tensor;
}class ORT\Tensor\Generator\Random {
public function __construct(int $type, int $min = 0, int $max = 1);
public function __invoke(): mixed;
}Only available where ONNXRuntime is available (ie, php-ort was built with --with-ort-onnx).
class ORT\Model {
public function __construct(
string $name,
string $source = '',
bool $array = false,
?ORT\Options $options = null
);
public static function unload(string $name): bool;
public function getName(): string;
public function getFile(): string;
public function getInput(int $index): string;
public function getInputCount(): int;
public function getInputIterator(): ORT\Model\Iterator;
public function getOutput(int $index): string;
public function getOutputCount(): int;
public function getOutputIterator(): ORT\Model\Iterator;
public function getMeta(string $property): mixed;
}Only available where ONNXRuntime is available (ie, php-ort was built with --with-ort-onnx).
class ORT\Runtime {
public function __construct(ORT\Model $model);
public function run(array $input): mixed;
}Only available where ONNXRuntime is available (ie, php-ort was built with --with-ort-onnx).
class ORT\Options {
// Log Levels
const int LVERBOSE = 0;
const int LINFO = 1;
const int LWARNING = 2;
const int LERROR = 3;
const int LFATAL = 4;
// Execution Modes
const int ESEQUENTIAL = 0;
const int EPARALLEL = 1;
// Graph Optimization Levels
const int ONONE = 0;
const int OBASIC = 1;
const int OEXTENDED = 2;
const int OALL = 99;
public function __construct();
public function setExecutionMode(int $mode): void;
public function setGraphOptimization(int $optimization): void;
public function setLogId(string $id): void;
public function setLogSeverity(int $severity): void;
public function setLogVerbosity(int $verbosity): void;
}ORT\Status\Error- Base error classORT\Status\Tensor\ErrorORT\Status\Tensor\NotFoundORT\Status\Tensor\InvalidTypeORT\Status\Tensor\InvalidShapeORT\Status\Tensor\InvalidDataORT\Status\Tensor\InvalidMemoryORT\Status\Tensor\InvalidOffsetORT\Status\Tensor\InvalidAccess
ORT\Status\Math\ErrorORT\Status\Math\InvalidShapeORT\Status\Math\InvalidTypeORT\Status\Math\InvalidBroadcastORT\Status\Math\InvalidOperationORT\Status\Math\DivisionByZero
ORT\Status\Model\ErrorORT\Status\Model\InvalidMemoryORT\Status\Model\InvalidOptionsORT\Status\Model\InvalidModelORT\Status\Model\InvalidInputORT\Status\Model\InvalidOutputORT\Status\Model\InvalidIndexORT\Status\Model\InvalidFileORT\Status\Model\RuntimeException
ORT\Status\Schema\ErrorORT\Status\Schema\InvalidSymbolORT\Status\Schema\InvalidArguments
ORT\Status\SafetyErrorORT\Status\ScalingError