Skip to content

tenzr::OpRegistrationBuilder

More...

#include <op_registry.h>

Public Functions

Name
OpRegistrationBuilder(std::string name)
OpRegistrationBuilder & Category(OpCategory cat)
Set the operator category.
OpRegistrationBuilder & StablehloOp(std::string op)
Set the StableHLO lowering name.
OpRegistrationBuilder & shape(ShapeInferenceFn fn)
Set the shape inference callback.
OpRegistrationBuilder & Dtype(DTypeInferenceFn fn)
Set the dtype inference callback.
OpRegistrationBuilder & Emit(EmitFn fn)
Set the StableHLO emitter callback.

Detailed Description

class tenzr::OpRegistrationBuilder;

Fluent builder used with the TENZR_REGISTER_OP macro to describe and register an operator.

Public Functions Documentation

function OpRegistrationBuilder

explicit OpRegistrationBuilder(
    std::string name
)

Parameters:

  • name Operator name.

Begin building an operator registration with the given name.

function Category

OpRegistrationBuilder & Category(
    OpCategory cat
)

Set the operator category.

Parameters:

  • cat Category to assign.

Return: This builder.

Set the operator category.

function StablehloOp

OpRegistrationBuilder & StablehloOp(
    std::string op
)

Set the StableHLO lowering name.

Parameters:

  • op StableHLO op name.

Return: This builder.

Set the StableHLO lowering and publish the operator.

function shape

OpRegistrationBuilder & shape(
    ShapeInferenceFn fn
)

Set the shape inference callback.

Parameters:

  • fn Shape inference callback.

Return: This builder.

Set the shape inference function and publish the operator.

function Dtype

OpRegistrationBuilder & Dtype(
    DTypeInferenceFn fn
)

Set the dtype inference callback.

Parameters:

  • fn Dtype inference callback.

Return: This builder.

Set the dtype inference function and publish the operator.

function Emit

OpRegistrationBuilder & Emit(
    EmitFn fn
)

Set the StableHLO emitter callback.

Parameters:

  • fn Emission callback.

Return: This builder.

Set the MLIR emission function and publish the operator.