@Namespace(value="torch") @NoOffset @Properties(inherit=torch.class) public class Library extends Pointer
// Examples:
TORCH_LIBRARY(torchvision, m) {
// m is a torch::Library
m.def("roi_align", ...);
...
}
TORCH_LIBRARY_IMPL(aten, XLA, m) {
// m is a torch::Library
m.impl("add", ...);
...
}
Modifier and Type | Class and Description |
---|---|
static class |
Library.Kind
\private
Which type of macro produced this Library
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Library(int kind,
String ns,
DispatchKeyOptional k,
String file,
int line) |
Library(Library.Kind kind,
BytePointer ns,
DispatchKeyOptional k,
BytePointer file,
int line)
\private
Use TORCH_LIBRARY() or TORCH_LIBRARY_IMPL() instead of using these
constructors directly
|
Library(Library arg0) |
Library(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
OperatorName |
_resolve(BytePointer name)
Register an implementation for an operator.
|
OperatorName |
_resolve(String name) |
Library |
def(DisabledStr arg0)
\private
Convenience overload for directly specifying the dispatch key when
impl().
|
Library |
def(EnabledStr raw_schema) |
Library |
put(Library arg0) |
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 Library(Pointer p)
Pointer(Pointer)
.public Library(Library.Kind kind, @StdString BytePointer ns, @ByVal DispatchKeyOptional k, @Cast(value="const char*") BytePointer file, @Cast(value="uint32_t") int line)
public Library(@Cast(value="torch::Library::Kind") int kind, @StdString String ns, @ByVal DispatchKeyOptional k, String file, @Cast(value="uint32_t") int line)
@ByVal public OperatorName _resolve(@Cast(value="const char*") BytePointer name)
name
- The name of the operator to implement. Do NOT provide
schema here.raw_f
- The C++ function that implements this operator. Any
valid constructor of torch::CppFunction is accepted here;
typically you provide a function pointer or lambda.
// Example:
TORCH_LIBRARY_IMPL(myops, CUDA, m) {
m.impl("add", add_cuda);
}
@ByVal public OperatorName _resolve(String name)
@ByRef public Library def(@ByVal DisabledStr arg0)
@ByRef public Library def(@ByVal EnabledStr raw_schema)
Copyright © 2024. All rights reserved.