vector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

README

vector

vector provides standard vector math functions that always operate on 1D views of tensor inputs, regardless of the original tensor shape.

Documentation

Overview

Package vector provides standard vector math functions that always operate on 1D views of tensor inputs regardless of the original vector shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dot

func Dot(a, b tensor.Tensor) tensor.Values

Dot performs the vector dot product: the Sum of the Mul product of the two tensors, returning a scalar value. Also known as the inner product.

func L1Norm

func L1Norm(a tensor.Tensor) tensor.Values

L1Norm returns the length of the vector as the L1 Norm: sum of the absolute values of the tensor, as a scalar.

func L2Norm

func L2Norm(a tensor.Tensor) tensor.Values

L2Norm returns the length of the vector as the L2 Norm: square root of the sum of squared values of the vector, as a scalar. This is the Sqrt of the Dot product of the vector with itself.

func Mul

func Mul(a, b tensor.Tensor) tensor.Values

Mul multiplies two vectors element-wise, using a 1D vector view of the two vectors, returning the output 1D vector.

func MulOut

func MulOut(a, b tensor.Tensor, out tensor.Values) error

MulOut multiplies two vectors element-wise, using a 1D vector view of the two vectors, filling in values in the output 1D vector.

func Sum

func Sum(a tensor.Tensor) tensor.Values

Sum returns the sum of all values in the tensor, as a scalar.

Types

This section is empty.

Jump to

Keyboard shortcuts

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