Documentation
¶
Overview ¶
Package utils holds small utility types and functions used internally in stablehlo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultCPUVersion = "v0.83.3"
DefaultCPUVersion is the default version of the CPU PJRT plugin to use with this go-xla release, against which it was tested. Exported in pkg/pjrt, but a copy is kept here to pkg/installer can include it without pulling the whole of PJRT.
Functions ¶
func DTypeToStableHLO ¶
func NormalizeIdentifier ¶
NormalizeIdentifier converts the name of an identifier (function name or function input parameter name) to a valid one: only letters, digits, and underscores are allowed.
Invalid characters are replaced with underscores. If the name starts with a digit, it is prefixed with an underscore.
func SortedKeys ¶
SortedKeys returns the keys of the set in sorted order.
func ToSnakeCase ¶
ToSnakeCase converts a string from CamelCase to snake_case.
Types ¶
type Set ¶
type Set[T comparable] map[T]struct{}
Set implements a Set for the key type T.
func MakeSet ¶
func MakeSet[T comparable](size ...int) Set[T]
MakeSet returns an empty Set of the given type. Size is optional, and if given will reserve the expected size.
func SetWith ¶
func SetWith[T comparable](elements ...T) Set[T]
SetWith creates a Set[T] with the given elements inserted.