types

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Overview

Package types is mostly a top level directory for GoMLX important types. See sub-packages `shapes`, `tensor` and `slices`.

This package also provides the types: Set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 added in v0.11.0

func SetWith[T comparable](elements ...T) Set[T]

SetWith creates a Set[T] with the given elements inserted.

func (Set[T]) Equal added in v0.17.1

func (s Set[T]) Equal(s2 Set[T]) bool

Equal returns whether s and s2 have the exact same elements.

func (Set[T]) Has

func (s Set[T]) Has(key T) bool

Has returns true if Set s has the given key.

func (Set[T]) Insert

func (s Set[T]) Insert(keys ...T)

Insert keys into set.

func (Set[T]) Sub added in v0.4.0

func (s Set[T]) Sub(s2 Set[T]) Set[T]

Sub returns `s - s2`, that is, all elements in `s` that are not in `s2`.

Directories

Path Synopsis
Package shapes defines Shape and DType and associated tools.
Package shapes defines Shape and DType and associated tools.
Package tensors implements a `Tensor`, a representation of a multi-dimensional array.
Package tensors implements a `Tensor`, a representation of a multi-dimensional array.
images
Package images provides several functions to transform images back and forth from tensors.
Package images provides several functions to transform images back and forth from tensors.
Package xslices provide missing functionality to the slices package.
Package xslices provide missing functionality to the slices package.
Package xsync implements some extra synchronization tools.
Package xsync implements some extra synchronization tools.

Jump to

Keyboard shortcuts

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