Share via


VBufferEditor<T>.CommitTruncated(Int32) Method

Definition

Commits the edits and creates a new VBuffer<T> using the current Values and Indices, while allowing to truncate the length of Values and, if sparse, Indices. Like Commit(), this structure and its properties should not be used once this is called.

public Microsoft.ML.Data.VBuffer<T> CommitTruncated (int physicalValuesCount);
member this.CommitTruncated : int -> Microsoft.ML.Data.VBuffer<'T>
Public Function CommitTruncated (physicalValuesCount As Integer) As VBuffer(Of T)

Parameters

physicalValuesCount
Int32

The new number of physical values to be represented in the created buffer.

Returns

The newly created VBuffer<T>.

Remarks

This method allows to modify the length of the explicitly defined values. This is useful in sparse situations where the VBufferEditor<T> was created with a larger physical value count than was needed because the final value count was not known at creation time.

Applies to