types

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

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 (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 exceptions provides helper functions to leverage Go's `panic`, `recover` and `defer` as an "exceptions" system.
Package exceptions provides helper functions to leverage Go's `panic`, `recover` and `defer` as an "exceptions" system.
Package keepalive provides a simple Acquire and Release mechanism to make sure data is kept alive in between.
Package keepalive provides a simple Acquire and Release mechanism to make sure data is kept alive in between.
Package shapes defines Shape and DType and associated tools.
Package shapes defines Shape and DType and associated tools.
Package slices are
Package slices are
Package tensor provides a `Tensor` interface with 2 different implementations: `Local` and `Device`, they differ on where their values are stored: in the local (host) CPU, or on an accelerator device (TPU, GPU, but could be also the CPU if no accelerators are available).
Package tensor provides a `Tensor` interface with 2 different implementations: `Local` and `Device`, they differ on where their values are stored: in the local (host) CPU, or on an accelerator device (TPU, GPU, but could be also the CPU if no accelerators are available).
image
Package image provides several functions to transform images back and forth from tensors.
Package image provides several functions to transform images back and forth from tensors.

Jump to

Keyboard shortcuts

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