Table of Contents

Namespace Bonsai.ML.Torch

Classes

ARange

Creates a 1-D tensor of values within a given range given the start, end, and step.

BooleanIndex

Represents a boolean index that can be used to select elements from a tensor.

Clone

Clones the input tensor.

ColonIndex

Represents the colon index used to select all elements along a given dimension.

Concat

Concatenates tensors along a given dimension.

ConvertScalarType

Converts the data type of the input tensor to the newly specified scalar type.

ConvertToArray

Converts the input tensor into a flattened array of the specified element type.

ConvertToNDArray

Converts the input tensor into an array of the specified element type and rank.

CreateTensor

Creates a tensor from the specified values. Uses Python-like syntax to specify the tensor values. For example, a 2x2 tensor can be created with the following values: "[[1, 2], [3, 4]]".

EllipsisIndex

Represents an index that selects all dimensions of a tensor.

Empty

Creates an empty tensor with the given data type and size.

Index

Indexes a tensor by parsing the specified indices. Indices are specified as a comma-separated values. Currently supports Python-style slicing syntax, which includes numerical indices, None, slices, and ellipsis.

InitializeTorchDevice

Initializes the Torch device with the specified device type.

LinSpace

Creates a 1-D tensor of equally spaced values within a given range given the start, end, and count.

LoadTensor

Loads a tensor from the specified file.

Mean

Takes the mean of the tensor along the specified dimensions.

MeshGrid

Creates a mesh grid from an observable sequence of enumerable of 1-D tensors.

NoneIndex

Represents an index that selects no elements of a tensor.

Ones

Creates a tensor filled with ones.

OpenCVHelper

Helper class to convert between OpenCV mats, images and Torch tensors.

Permute

Permutes the dimensions of the input tensor according to the specified permutation.

Reshape

Reshapes the input tensor according to the specified dimensions.

SaveTensor

Saves the input tensor to the specified file.

ScalarTypeConverter

Represents a type converter for data types that are currently supported between .NET types and torch TorchSharp.torch.ScalarType.

Set

Sets values of a tensor to the provided values at the specified index.

SingleIndex

Represents an index that selects a single value of a tensor.

SliceIndex

Represents an index that selects a range of elements from a tensor.

Stack

Stacks tensors along a new dimension. All tensors need to be of the same size.

Sum

Computes the sum of the input tensor elements along the specified dimensions.

TensorConverter

Represents a type converter for tensors to and from string.

TensorIndex

Represents an index that is created from a tensor.

Tile

Constructs a tensor by repeating the elements of input.

ToDevice

Moves the input tensor to the specified device.

ToImage

Converts the input tensor into an OpenCV image.

ToMat

Converts the input tensor into an OpenCV mat.

ToTensor

Converts the input value into a tensor.

View

Creates a new view of the input tensor with the specified dimensions.

Zeros

Creates a tensor filled with zeros.

Interfaces

IScalarTypeProvider

An interface that defines a class which provides scalar type information.