BackendTensorStatics Type

Represents the static functionality for tensors implemented by a DiffSharp backend.

Constructors

Constructor Description

BackendTensorStatics()

Full Usage: BackendTensorStatics()

Returns: BackendTensorStatics
Returns: BackendTensorStatics

Instance members

Instance member Description

this.CreateFromFlatArray

Full Usage: this.CreateFromFlatArray

Parameters:
Returns: RawTensor
Modifiers: abstract

Create a tensor of appropriate dtype from a scalar or array of appropriate values. A backend type is delivered consistent with in-memory data - a type for dtype Int32 gets int32 data etc.

data : Array
shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

this.Empty

Full Usage: this.Empty

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with arbitrary values for the given shape and device

shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

this.Full

Full Usage: this.Full

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with the given value for the given shape and device

shape : Shape
value : scalar
dtype : Dtype
device : Device
Returns: RawTensor

this.GetDevices

Full Usage: this.GetDevices

Parameters:
Returns: Device list
Modifiers: abstract

Gets the devices supported by this backend

?deviceType : DeviceType
Returns: Device list

this.IsDeviceTypeAvailable

Full Usage: this.IsDeviceTypeAvailable

Parameters:
Returns: bool
Modifiers: abstract

Indicates if a device type is supported by this backend

deviceType : DeviceType
Returns: bool

this.One

Full Usage: this.One

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets the scalar 1 tensor for the given device

dtype : Dtype
device : Device
Returns: RawTensor

this.Ones

Full Usage: this.Ones

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with ones for the given shape and device

shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

this.Random

Full Usage: this.Random

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with random values for the given shape and device

shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

this.RandomInt

Full Usage: this.RandomInt

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with random integers from the given range for the given shape and device

shape : Shape
low : int
high : int
dtype : Dtype
device : Device
Returns: RawTensor

this.RandomNormal

Full Usage: this.RandomNormal

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with random values from the normal distribution for the given shape and device

shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

this.Seed

Full Usage: this.Seed

Parameters:
    seed : int

Modifiers: abstract

Sets the seed for the default random number generator of the backend

seed : int

this.Zero

Full Usage: this.Zero

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets the scalar 0 tensor for the given device

dtype : Dtype
device : Device
Returns: RawTensor

this.Zeros

Full Usage: this.Zeros

Parameters:
Returns: RawTensor
Modifiers: abstract

Gets a tensor filled with zeros for the given shape and device

shape : Shape
dtype : Dtype
device : Device
Returns: RawTensor

Static members

Static member Description

BackendTensorStatics.Get(?backend)

Full Usage: BackendTensorStatics.Get(?backend)

Parameters:
Returns: BackendTensorStatics

Get the backend implementation for the given tensor element type and backend.

?backend : Backend
Returns: BackendTensorStatics

BackendTensorStatics.Seed(?seed)

Full Usage: BackendTensorStatics.Seed(?seed)

Parameters:
    ?seed : int

Seed all backends with the given random seed, or a new seed based on the current time if no seed is specified.

?seed : int

© Copyright 2021, DiffSharp Contributors.