Table of Contents

Struct DetachedTensor<T>

Namespace
AiDotNet.SelfSupervisedLearning
Assembly
AiDotNet.dll

A wrapper that marks a tensor as detached from the computation graph.

public readonly struct DetachedTensor<T> : IDetachedTensor<T>

Type Parameters

T

The numeric type.

Implements
Inherited Members

Constructors

DetachedTensor(Tensor<T>)

Initializes a new DetachedTensor wrapping the given tensor.

public DetachedTensor(Tensor<T> tensor)

Parameters

tensor Tensor<T>

The tensor to wrap (will be copied).

Properties

Data

Gets the underlying tensor data.

public Tensor<T> Data { get; }

Property Value

Tensor<T>

Methods

From(Tensor<T>)

Creates a DetachedTensor from a regular tensor.

public static DetachedTensor<T> From(Tensor<T> tensor)

Parameters

tensor Tensor<T>

Returns

DetachedTensor<T>

Operators

implicit operator Tensor<T>(DetachedTensor<T>)

Implicitly converts a DetachedTensor to its underlying Tensor.

public static implicit operator Tensor<T>(DetachedTensor<T> detached)

Parameters

detached DetachedTensor<T>

Returns

Tensor<T>