Table of Contents

Class TensorShapeMismatchException

Namespace
AiDotNet.Exceptions
Assembly
AiDotNet.dll

Exception thrown when a tensor's shape doesn't match the expected shape.

public class TensorShapeMismatchException : AiDotNetException, ISerializable
Inheritance
TensorShapeMismatchException
Implements
Inherited Members

Constructors

TensorShapeMismatchException()

Initializes a new instance of the TensorShapeMismatchException class.

public TensorShapeMismatchException()

TensorShapeMismatchException(int[], int[], string)

Initializes a new instance of the TensorShapeMismatchException class with a simplified context.

public TensorShapeMismatchException(int[] expectedShape, int[] actualShape, string context)

Parameters

expectedShape int[]

The expected shape of the tensor.

actualShape int[]

The actual shape of the tensor.

context string

Additional context about where the mismatch occurred.

TensorShapeMismatchException(int[], int[], string, string)

Initializes a new instance of the TensorShapeMismatchException class.

public TensorShapeMismatchException(int[] expectedShape, int[] actualShape, string component, string operation)

Parameters

expectedShape int[]

The expected shape of the tensor.

actualShape int[]

The actual shape of the tensor.

component string

The component where the shape mismatch occurred.

operation string

The operation being performed when the mismatch was detected.

TensorShapeMismatchException(int[], int[], string, string, Exception)

Initializes a new instance of the TensorShapeMismatchException class with shape information and a reference to the inner exception that is the cause of this exception.

public TensorShapeMismatchException(int[] expectedShape, int[] actualShape, string component, string operation, Exception innerException)

Parameters

expectedShape int[]

The expected shape of the tensor.

actualShape int[]

The actual shape of the tensor.

component string

The component where the shape mismatch occurred.

operation string

The operation being performed when the mismatch was detected.

innerException Exception

The exception that is the cause of the current exception.

TensorShapeMismatchException(string)

Initializes a new instance of the TensorShapeMismatchException class with a specified error message.

public TensorShapeMismatchException(string message)

Parameters

message string

The message that describes the error.

TensorShapeMismatchException(string, Exception)

Initializes a new instance of the TensorShapeMismatchException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public TensorShapeMismatchException(string message, Exception innerException)

Parameters

message string

The message that describes the error.

innerException Exception

The exception that is the cause of the current exception.

Properties

ActualShape

The actual shape of the tensor.

public int[] ActualShape { get; }

Property Value

int[]

Component

The component where the shape mismatch occurred.

public string Component { get; }

Property Value

string

ExpectedShape

The expected shape of the tensor.

public int[] ExpectedShape { get; }

Property Value

int[]

Operation

The operation being performed when the mismatch was detected.

public string Operation { get; }

Property Value

string