語言

IReadOnlyTensor<TSelf,T>.TryFlattenTo(Span<T>) 方法

定義

嘗試將該張量的內容壓平成目的區間,並回傳一個值以指示操作是否成功。

public:
 bool TryFlattenTo(Span<T> destination);
public bool TryFlattenTo(scoped Span<T> destination);
abstract member TryFlattenTo : Span<'T> -> bool
Public Function TryFlattenTo (destination As Span(Of T)) As Boolean

參數

destination
Span<T>

複製行動的目標。

傳回

true若複製操作成功;否則,。 false

例外狀況

來源與 destination 重疊在無支援的版面配置中。

備註

支援重疊的密集張量。 其他重疊版面會先丟棄 ArgumentException 再複製。

若長度 destination 短於來源,則不會複製任何項目,方法回傳 false。

適用於