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
TThe numeric type.
- Implements
- Inherited Members
Constructors
DetachedTensor(Tensor<T>)
Initializes a new DetachedTensor wrapping the given tensor.
public DetachedTensor(Tensor<T> tensor)
Parameters
tensorTensor<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
tensorTensor<T>
Returns
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
detachedDetachedTensor<T>
Returns
- Tensor<T>