@Namespace(value="c10") @NoOffset @Properties(inherit=torch.class) public class Error extends Pointer
what()
, and a more concise message via what_without_backtrace()
.
Don't throw this directly; use TORCH_CHECK/TORCH_INTERNAL_ASSERT instead.
NB: c10::Error is handled specially by the default torch to suppress the
backtrace, see torch/csrc/Exceptions.hPointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Error(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add_context(BytePointer msg) |
void |
add_context(String msg) |
BytePointer |
backtrace() |
Pointer |
caller() |
StringVector |
context() |
BytePointer |
msg() |
BytePointer |
what_without_backtrace()
Returns only the error message string, without source location.
|
BytePointer |
what()
Returns the complete error message, including the source location.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public Error(Pointer p)
Pointer(Pointer)
.public void add_context(@StdString BytePointer msg)
public void add_context(@StdString String msg)
@StdString public BytePointer msg()
@Const @ByRef public StringVector context()
@StdString public BytePointer backtrace()
@NoException(value=true) @Cast(value="const char*") public BytePointer what()
@Const @NoException(value=true) public Pointer caller()
@NoException(value=true) @Cast(value="const char*") public BytePointer what_without_backtrace()
Copyright © 2024. All rights reserved.