optypes

package
v0.4.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package optypes defines OpType and lists the supported operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpTypeStrings

func OpTypeStrings() []string

OpTypeStrings returns a slice of all String values of the enum

Types

type OpType

type OpType int

OpType is an enum of all generic operations that ToStableHLO can support -- not all are implemented yet.

const (
	Invalid OpType = iota
	FuncReturn
	Constant
	Identity

	Abs
	Add
	AllGather
	AllReduce
	AllToAll
	And
	Atan2
	BatchNormInference
	BatchNormTraining
	BatchNormGrad
	BitcastConvert
	BroadcastInDim
	Call
	Cbrt
	Ceil
	Clamp
	CollectiveBroadcast
	CollectivePermute
	Compare
	Complex
	Concatenate
	Convert
	Convolution
	Cosine
	CountLeadingZeros
	Divide
	DotGeneral
	DynamicBroadcastInDim
	DynamicConv
	DynamicGather
	DynamicIota
	DynamicPad
	DynamicSlice
	DynamicUpdateSlice
	Erf
	Exponential
	ExponentialMinusOne
	Fft
	Floor
	Gather
	If
	Imag
	IsFinite
	Iota
	Log
	LogPlusOne
	Logistic
	Maximum
	Minimum
	Multiply
	Negate
	Not
	OptimizationBarrier
	Or
	Pad
	Popcnt
	Power
	Real
	Remainder
	Reduce
	ReduceWindow
	Reshape
	Reverse
	RNGBitGenerator
	RoundNearestAfz
	RoundNearestEven
	Rsqrt
	Scatter
	Select
	SelectAndScatter
	ShiftLeft
	ShiftRightArithmetic
	ShiftRightLogical
	Sign
	Sine
	Slice
	Sort
	Sqrt
	Subtract
	Tan
	Tanh
	Transpose
	UniformDequantize
	UniformQuantize
	While
	Xor

	GetDimensionSize

	Case
	Cholesky
	Composite
	CustomCall
	DynamicReshape
	GetTupleElement
	Infeed
	Outfeed
	PartitionId
	Recv
	ReducePrecision
	ReduceScatter
	Send
	TriangularSolve
	Tuple

	// Last should always be kept the last, it is used as a counter/marker for .
	Last
)

func OpTypeString

func OpTypeString(s string) (OpType, error)

OpTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func OpTypeValues

func OpTypeValues() []OpType

OpTypeValues returns all values of the enum

func (OpType) IsAOpType

func (i OpType) IsAOpType() bool

IsAOpType returns "true" if the value is listed in the enum definition. "false" otherwise

func (OpType) String

func (i OpType) String() string

func (OpType) ToStableHLO

func (op OpType) ToStableHLO() string

ToStableHLO returns the ToStableHLO name of the operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL