@Namespace(value="cv::dnn") @Properties(inherit=opencv_dnn.class) public class EinsumLayer extends Layer
c = einsum("i,j", a, b)
, then c[i,j] == a[i]*b[j]
.
However, if c = einsum("j,i", a, b)
, then c[i,j] = a[j]*b[i]
.
Alternatively, you can control the output order or prevent
an axis from being summed/force an axis to be summed
by providing indices for the output.
For example:
diag(a)
-> einsum("ii->i", a)
sum(a, axis=0)
-> einsum("i...->", a)
Subscripts at the beginning and end may be specified
by putting an ellipsis "..." in the middle.
For instance, the function einsum("i...i", a)
takes
the diagonal of the first and last dimensions of
the operand, and einsum("ij...,jk...->ik...")
performs
the matrix product using the first two indices
of each operand instead of the last two.
When there is only one operand, no axes being summed,
and no output parameter, this function returns
a view into the operand instead of creating a copy.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
EinsumLayer()
Default native constructor.
|
EinsumLayer(long size)
Native array allocator.
|
EinsumLayer(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
static EinsumLayer |
create(LayerParams params) |
EinsumLayer |
getPointer(long i) |
EinsumLayer |
position(long position) |
applyHalideScheduler, asAlgorithm, asAlgorithm, blobs, blobs, finalize, finalize, finalize, finalize, finalize, forward_fallback, forward_fallback, forward_fallback, forward, forward, forward, forward, getFLOPS, getMemoryShapes, getScaleShift, getScaleZeropoint, getScaleZeropoint, getScaleZeropoint, inputNameToIndex, inputNameToIndex, name, name, outputNameToIndex, outputNameToIndex, preferableTarget, preferableTarget, run, setActivation, setParamsFrom, supportBackend, tryAttach, tryFuse, tryQuantize, type, type, unsetAttached, updateMemoryShapes
clear, empty, getDefaultName, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public EinsumLayer()
public EinsumLayer(long size)
Pointer.position(long)
.public EinsumLayer(Pointer p)
Pointer(Pointer)
.public EinsumLayer position(long position)
public EinsumLayer getPointer(long i)
getPointer
in class Layer
@opencv_core.Ptr public static EinsumLayer create(@Const @ByRef LayerParams params)
Copyright © 2024. All rights reserved.