tensor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertTensorFormat

func AssertTensorFormat(t Tensor) error

func BuildTensor

func BuildTensor(dimension int, numAxes int) interface{}

func Convert

func Convert(val interface{}, typ reflect.Type) (interface{}, error)

func VerticalVector

func VerticalVector(a Tensor, pos int) []float64

Types

type Tensor

type Tensor struct {
	Rows, Cols   int
	Data         [][]float64
	RequiresGrad bool
}

func AddScalar

func AddScalar(a Tensor, scalar float64) Tensor

func Dot

func Dot(a, b Tensor) Tensor

func DotScalar

func DotScalar(a Tensor, scalar float64) Tensor

func NewTensor

func NewTensor(data [][]float64) Tensor

func Pow

func Pow(a Tensor, pow float64) Tensor

func Rand

func Rand(rows, cols int) Tensor

func ReLU

func ReLU(a Tensor) Tensor

func ScalarMinusTensor

func ScalarMinusTensor(a Tensor, scalar float64) Tensor

func Softmax

func Softmax(tensor Tensor) Tensor

func Sub

func Sub(a, b Tensor) Tensor

func Sum

func Sum(params ...Tensor) Tensor

func Tanh

func Tanh(a Tensor) Tensor

func TensorOpsScalar

func TensorOpsScalar(a Tensor, b float64, ops string) Tensor

func TensorOpsTensor

func TensorOpsTensor(a Tensor, b Tensor, ops string) Tensor

func TensorOpsTensorWithBroadcasting

func TensorOpsTensorWithBroadcasting(a Tensor, b Tensor, ops string) Tensor

func Zeros

func Zeros(rows, cols int) Tensor

func (Tensor) IsEqualTo

func (t Tensor) IsEqualTo(tb Tensor) bool

func (*Tensor) Reshape

func (t *Tensor) Reshape(shape []int) Tensor

func (Tensor) SameTensorRowColShape

func (t Tensor) SameTensorRowColShape(tb Tensor) error

func (Tensor) SameTensorShape

func (t Tensor) SameTensorShape(tb Tensor) error

func (Tensor) Shape

func (t Tensor) Shape() []int

func (Tensor) Transpose

func (t Tensor) Transpose() Tensor

Jump to

Keyboard shortcuts

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