TensorBoolean Class

Definition

A boolean tensor object.

public ref class TensorBoolean sealed : ITensor
public ref class TensorBoolean sealed : ITensor, IClosable, IMemoryBuffer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772166)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.AI.MachineLearning.ITensorBooleanStatics, 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TensorBoolean sealed : ITensor
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.DualApiPartition(version=167772166)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.AI.MachineLearning.ITensorBooleanStatics, 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Static(Windows.AI.MachineLearning.ITensorBooleanStatics2, 131072, "Windows.AI.MachineLearning.MachineLearningContract")]
class TensorBoolean sealed : ITensor, IClosable, IMemoryBuffer
/// [Windows.Foundation.Metadata.ContractVersion(Windows.AI.MachineLearning.MachineLearningContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.AI.MachineLearning.ITensorBooleanStatics, 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Static(Windows.AI.MachineLearning.ITensorBooleanStatics2, 131072, "Windows.AI.MachineLearning.MachineLearningContract")]
/// [Windows.Foundation.Metadata.DualApiPartition(version=1)]
class TensorBoolean sealed : ITensor, IClosable, IMemoryBuffer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772166)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.AI.MachineLearning.ITensorBooleanStatics), 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TensorBoolean : ITensor
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.DualApiPartition(version=167772166)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.AI.MachineLearning.ITensorBooleanStatics), 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.AI.MachineLearning.ITensorBooleanStatics2), 131072, "Windows.AI.MachineLearning.MachineLearningContract")]
public sealed class TensorBoolean : System.IDisposable, ITensor, IMemoryBuffer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.AI.MachineLearning.MachineLearningContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.AI.MachineLearning.ITensorBooleanStatics), 65536, "Windows.AI.MachineLearning.MachineLearningContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.AI.MachineLearning.ITensorBooleanStatics2), 131072, "Windows.AI.MachineLearning.MachineLearningContract")]
[Windows.Foundation.Metadata.DualApiPartition(version=1)]
public sealed class TensorBoolean : System.IDisposable, ITensor, IMemoryBuffer
Public NotInheritable Class TensorBoolean
Implements ITensor
Public NotInheritable Class TensorBoolean
Implements IDisposable, IMemoryBuffer, ITensor
Inheritance
TensorBoolean
Attributes
Implements

Windows 10 requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.AI.MachineLearning.MachineLearningContract (introduced in v1.0)

Remarks

A tensor is a multi-dimensional array of values. A boolean tensor is a tensor of boolean values.

The layout of tensors is row-major, with tightly packed contiguous data representing each dimension. The total size of a tensor is the product of the size of each dimension.

Windows Server

To use this API on Windows Server, you must use Windows Server 2019 with Desktop Experience.

Thread safety

This API is thread-safe.

Version history

Windows version SDK version Value added
1903 18362 CreateFromBuffer
1903 18362 CreateFromShapeArrayAndDataArray

Properties

Kind

The kind of the feature.

Shape

Returns the count and size of each dimension.

TensorKind

Returns the data type of the tensor.

Methods

Close()

If there are no outstanding IMemoryBufferReference objects created from this object, Close will dispose of the object and destroy its associated resources. Otherwise, Close will detach itself from its associated resources and they will be destroyed when the last IMemoryBufferReference is closed.

Create()

Creates a boolean tensor object without allocating a buffer.

Create(IEnumerable<Int64>)

Creates a boolean tensor object and allocates a buffer of size shape.

CreateFromArray(IEnumerable<Int64>, Boolean[])

Creates a boolean tensor object, allocates a buffer of size shape, and copies all of data into it.

CreateFromBuffer(Int64[], IBuffer)

Creates a boolean tensor object with the given shape and uses the underlying buffer in data for subsequent evaluation.

CreateFromIterable(IEnumerable<Int64>, IEnumerable<Boolean>)

Creates a boolean tensor object, allocates a buffer of size shape, and copies all of data into it.

CreateFromShapeArrayAndDataArray(Int64[], Boolean[])

Creates a boolean tensor object, allocates a buffer of size shape, and copies all of data into it.

CreateReference()

Returns an IMemoryBufferReference representation of the buffer backing the boolean tensor object.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetAsVectorView()

Returns a read-only view of the data.

Applies to

See also