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
expectedShapeint[]The expected shape of the tensor.
actualShapeint[]The actual shape of the tensor.
contextstringAdditional 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
expectedShapeint[]The expected shape of the tensor.
actualShapeint[]The actual shape of the tensor.
componentstringThe component where the shape mismatch occurred.
operationstringThe 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
expectedShapeint[]The expected shape of the tensor.
actualShapeint[]The actual shape of the tensor.
componentstringThe component where the shape mismatch occurred.
operationstringThe operation being performed when the mismatch was detected.
innerExceptionExceptionThe 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
messagestringThe 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
messagestringThe message that describes the error.
innerExceptionExceptionThe 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
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; }