(arg-md pd arg)
Queries the primitive descriptor pd
for the argument's memory descriptor.
Queries the primitive descriptor `pd` for the argument's memory descriptor.
(args arg-map)
(batch-norm-bwd eng hint-fwd-pd prop-kind diff-data-desc data-desc & flags)
TODO
TODO
(batch-norm-bwd-args diff-dst src mean variance diff-src)
(batch-norm-bwd-args diff-dst src scale shift mean variance diff-src diff-scale)
(batch-norm-bwd-args diff-dst
src
scale
shift
mean
variance
diff-src
diff-scale
workspace)
(batch-norm-fwd-args src-and-dst)
(batch-norm-fwd-args src dst)
(batch-norm-fwd-args src dst mean variance)
(batch-norm-fwd-args src dst scale shift _)
(batch-norm-fwd-args src dst scale shift mean variance)
(batch-norm-fwd-args src dst scale shift mean variance workspace)
(binary eng alg-kind src-dst-desc)
(binary eng alg-kind src-dst-desc src1-desc)
(binary eng alg-kind src0-desc src1-desc dst-desc)
DNNL binary operation. NOTE: much slower than Neanderthal add or mul. Use only when can't avoid it.
DNNL binary operation. NOTE: much slower than Neanderthal add or mul. Use only when can't avoid it.
(binary-args src-and-dst src1)
(binary-args src0 src1 dst)
(bwd-args diff-dst weights diff-src)
(bwd-args src diff-dst diff-weights diff-bias)
(concatenate eng dst concat-dimension src)
(concatenate eng dst concat-dimension src & srcs)
TODO
TODO
(convolution-bwd-data eng
hint-fwd-pd
alg-kind
diff-src-desc
weights-desc
diff-dst-desc
strides
padding)
(convolution-bwd-data eng
hint-fwd-pd
alg-kind
diff-src-desc
weights-desc
diff-dst-desc
strides
dilates
padding)
(convolution-bwd-data eng
hint-fwd-pd
alg-kind
diff-src-desc
weights-desc
diff-dst-desc
strides
dilates
padding-l
padding-r)
TODO
TODO
(convolution-bwd-weights eng
hint-fwd-pd
alg-kind
src-desc
diff-weights-desc
diff-bias-desc
diff-dst-desc
strides
padding)
(convolution-bwd-weights eng
hint-fwd-pd
alg-kind
src-desc
diff-weights-desc
diff-bias-desc
diff-dst-desc
strides
dilates
padding)
(convolution-bwd-weights eng
hint-fwd-pd
alg-kind
src-desc
diff-weights-desc
diff-bias-desc
diff-dst-desc
strides
dilates
padding-l
padding-r)
TODO
TODO
(convolution-fwd eng
prop-kind
alg-kind
src-desc
weights-desc
bias-desc
dst-desc
strides
padding)
(convolution-fwd eng
prop-kind
alg-kind
src-desc
weights-desc
bias-desc
dst-desc
strides
dilates
padding)
(convolution-fwd eng
prop-kind
alg-kind
src-desc
weights-desc
bias-desc
dst-desc
strides
dilates
padding-l
padding-r)
TODO
TODO
(data-type mem-desc)
Queries the data type of a memory descriptor.
Queries the data type of a memory descriptor.
(diff-dst-md pd)
Queries the primitive descriptor pd
for the gradient of the destination (output).
Queries the primitive descriptor `pd` for the gradient of the destination (output).
(diff-src-md pd)
Queries the primitive descriptor pd
for the gradient of the source (input).
Queries the primitive descriptor `pd` for the gradient of the source (input).
(diff-weights-md pd)
Queries the primitive descriptor pd
for the gradient of the weights.
Queries the primitive descriptor `pd` for the gradient of the weights.
(dims mem-desc)
Queries the dimensions of a memory descriptor.
Queries the dimensions of a memory descriptor.
(dnnl-contiguous-desc md)
(dst-md pd)
Queries the primitive descriptor pd
for the destination (output).
Queries the primitive descriptor `pd` for the destination (output).
(eltwise-bwd eng hint-fwd-pd alg-kind diff-desc src-desc)
(eltwise-bwd eng hint-fwd-pd alg-kind diff-desc src-desc alpha beta)
Creates a backward descriptor of an operation that is applied to every element of a tensor. Used only during the training.
alg-kind
: operation algorithm, such as :relu
or :logistic
(defined in [[constants/dnnl-eltwise-alg-kind]]
)diff-desc
: the diff memory descriptorsrc-desc
: the source memory descriptordst-desc
: the destination memory descriptoralpha
, and beta
: optional coefficients, depending on alg-kind
.Creates a backward descriptor of an operation that is applied to every element of a tensor. Used only during the training. * `alg-kind`: operation algorithm, such as `:relu` or `:logistic` (defined in `[[constants/dnnl-eltwise-alg-kind]]`) * `diff-desc`: the diff memory descriptor * `src-desc`: the source memory descriptor * `dst-desc`: the destination memory descriptor * `alpha`, and `beta`: optional coefficients, depending on `alg-kind`.
(eltwise-bwd-args src diff-dst diff-src)
Creates DNNL's data structure that holds arguments as required by elementwise operations.
Creates DNNL's data structure that holds arguments as required by elementwise operations.
(eltwise-fwd eng prop-kind alg-kind mem-desc)
(eltwise-fwd eng prop-kind alg-kind mem-desc alpha beta)
Creates a forward descriptor of an operation that is applied to every element of a tensor.
prop-kind
: the kind of propagation: :inference
, training
, or :scoring
(defined in [[constants/dnnl-forward-prop-kind]]
)alg-kind
: operation algorithm, such as :relu
or :logistic
(defined in [[constants/dnnl-eltwise-alg-kind]]
)mem-desc
: the descriptor that defines memory layout of the dataalpha
, and beta
: optional coefficients, depending on alg-kind
.Creates a forward descriptor of an operation that is applied to every element of a tensor. * `prop-kind`: the kind of propagation: `:inference`, `training`, or `:scoring` (defined in `[[constants/dnnl-forward-prop-kind]]`) * `alg-kind`: operation algorithm, such as `:relu` or `:logistic` (defined in `[[constants/dnnl-eltwise-alg-kind]]`) * `mem-desc`: the descriptor that defines memory layout of the data * `alpha`, and `beta`: optional coefficients, depending on `alg-kind`.
(engine)
(engine id)
(engine id kind)
Creates an engine for the device id
of the specified keyword kind
.
Supported engine kinds are :cpu
, :gpu
, and :any
. The default kind is :cpu
.
Engine has to be release
d.
Throws an ExceptionInfo if the id
does not correspond to a physical device
or if kind
is not supported.
Creates an engine for the device `id` of the specified keyword `kind`. Supported engine kinds are `:cpu`, `:gpu`, and `:any`. The default kind is `:cpu`. Engine has to be `release`d. Throws an ExceptionInfo if the `id` does not correspond to a physical device or if `kind` is not supported.
(engine-count)
(engine-count kind)
Returns the number of physical engines of the specified kind
(:cpu
, :gpu
, :any
).
Throws an ExceptionInfo if kind
is not supported.
Returns the number of physical engines of the specified `kind` (`:cpu`, `:gpu`, `:any`). Throws an ExceptionInfo if `kind` is not supported.
(engine-kind eng)
Returns engine's kind as a keyword. Typical values are :gpu
and :cpu
.
Throws an ExceptionInfo if kind
is not supported.
Returns engine's kind as a keyword. Typical values are `:gpu` and `:cpu`. Throws an ExceptionInfo if `kind` is not supported.
(equal-desc? x y)
Compares two memory descriptors for logical equality.
Two descriptors may be equal even though the objects are not equal nor identical in the JVM sense.
Compares two memory descriptors for logical equality. Two descriptors may be equal even though the objects are not equal nor identical in the JVM sense.
(execute! strm p args)
Queues the operation primitive p
for execution in stream strm
.
Returns strm
. Throws an ExceptionInfo if the DNNL stream is not valid,
or the primitive cannot be executed.
Queues the operation primitive `p` for execution in stream `strm`. Returns `strm`. Throws an ExceptionInfo if the DNNL stream is not valid, or the primitive cannot be executed.
(extend-memory-desc-info t)
(fwd-args src-and-dst)
(fwd-args src dst)
(fwd-args src dst workspace)
(fwd-args src weights bias dst)
Creates DNNL's data structure that holds arguments as required by forward operations.
Creates DNNL's data structure that holds arguments as required by forward operations.
(get-engine mem)
Returns the engine context of the memory object mem
.
Returns the engine context of the memory object `mem`.
(gru-bwd eng
hint-fwd-pd
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc
diff-src-desc
diff-src-iter-desc
diff-weights-desc
diff-weights-iter-desc
diff-bias-desc
diff-dst-desc
diff-dst-iter-desc)
TODO
TODO
(gru-fwd eng
prop-kind
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc)
TODO
TODO
(inner-product-bwd eng hint-fwd-pd diff-src-desc weights-desc diff-dst-desc)
(inner-product-bwd eng
hint-fwd-pd
src-desc
diff-weights-desc
diff-bias-desc
diff-dst-desc)
Creates a descriptor for the backward phase of the inner product operation, for data (3-arguments) weights (5-arguments) updates.
The gradient of data computes diff-src <- f(weights, diff-dst)
:
diff-src-desc
: descriptor of the source gradient (input) memory.
weights-desc
: descriptor of the weights memory.
diff-dst-desc
: descriptor of the destination gradient (output) memory.
The gradient of data computes diff-weights <- f(diff-dst, src)
,
and diff-bias <- f(diff-dst, src)
:
src-desc
: descriptor of the source (input) memory.
diff-weights-desc
: descriptor of the weights gradient memory.
diff-bias-desc
: descriptor of the bias gradient memory.
diff-dst-desc
: descriptor of the destination gradient (output) memory.
Creates a descriptor for the backward phase of the inner product operation, for data (3-arguments) weights (5-arguments) updates. - The gradient of data computes `diff-src <- f(weights, diff-dst)`: `diff-src-desc`: descriptor of the source gradient (input) memory. `weights-desc`: descriptor of the weights memory. `diff-dst-desc`: descriptor of the destination gradient (output) memory. - The gradient of data computes `diff-weights <- f(diff-dst, src)`, and `diff-bias <- f(diff-dst, src)`: `src-desc`: descriptor of the source (input) memory. `diff-weights-desc`: descriptor of the weights gradient memory. `diff-bias-desc`: descriptor of the bias gradient memory. `diff-dst-desc`: descriptor of the destination gradient (output) memory.
(inner-product-fwd eng prop-kind src-desc weights-desc bias-desc dst-desc)
Creates a descriptor for the forward phase of the inner product operation,
which computes dst <- src * weights + bias
.
prop-kind
: one of the values defined in constants/dnnl-forward-prop-kind
(:inference
, :training
, :scoring
).
src-desc
: descriptor of the source (input) memory.
weights-desc
: descriptor of the weights memory.
bias-desc
: descriptor of the bias memory.
dst-desc
: descripror of the destination (output) memory.
Creates a descriptor for the forward phase of the inner product operation, which computes `dst <- src * weights + bias`. `prop-kind`: one of the values defined in [[constants/dnnl-forward-prop-kind]] (`:inference`, `:training`, `:scoring`). `src-desc`: descriptor of the source (input) memory. `weights-desc`: descriptor of the weights memory. `bias-desc`: descriptor of the bias memory. `dst-desc`: descripror of the destination (output) memory.
(lstm-bwd eng
hint-fwd-pd
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc
diff-src-desc
diff-src-iter-desc
diff-weights-desc
diff-weights-iter-desc
diff-bias-desc
diff-dst-desc
diff-dst-iter-desc)
(lstm-bwd eng
hint-fwd-pd
direction
src-desc
src-iter-desc
src-iter-c-desc
weights-iter-peephole-projection
bias-desc
dst-desc
dst-iter-desc
dst-iter-c-desc
diff-src-desc
diff-src-iter-desc
diff-src-iter-c-desc
diff-weights-iter-peephole-projection
diff-bias-desc
diff-dst-desc
diff-dst-iter-desc
diff-dst-iter-c-desc)
TODO
TODO
(lstm-fwd eng
prop-kind
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc)
(lstm-fwd eng
prop-kind
direction
src-desc
src-iter-desc
src-iter-c-desc
weights-desc
weights-iter-desc
weights-peephole-desc
weights-projection-desc
bias-desc
dst-desc
dst-iter-desc
dst-iter-c-desc)
TODO
TODO
(memory eng mem-desc)
(memory eng mem-desc buf)
(memory eng mem-desc buf master)
An engine-specific memory handle for a raw buffer and a matching descriptor.
eng
a DNNL engine that controls the context.
mem-desc
logical memory descriptor.
buf
JavaCPP pointer instance.
master
indicates whether this memory object handles the life cycle of buf
.
An engine-specific memory handle for a raw buffer and a matching descriptor. `eng` a DNNL engine that controls the context. `mem-desc` logical memory descriptor. `buf` JavaCPP pointer instance. `master` indicates whether this memory object handles the life cycle of `buf`.
(memory-desc)
(memory-desc dims)
(memory-desc dims format)
(memory-desc dims data-type format)
Creates an engine-agnostic, logical, description of data, based on dimensions, data type and data format.
dims
is a Clojure vector of positive numbers representing dimensions in the
:abcdef
format, regardless of the physical layout of dimensions.
data-type
is a keyword that specifies one of the supported types of data,
defined in [[constants/dnnl-data-type
]] (:float
, :int
, etc.)
format
specifies an (optional) physical layout as a keyword, choosing one
of [[constants/dnnl-format
]] (:nchw
, :acdeb
, :any
, etc.), or through
strides specified as a Clojure vector of positive numbers that match logical
dimensions.
Examples:
(memory-desc [2 3] :float :nc)
(memory-desc [2 3 4 5] :float [120 3 4 5])
Creates an engine-agnostic, logical, description of data, based on dimensions, data type and data format. `dims` is a Clojure vector of positive numbers representing dimensions in the `:abcdef` format, regardless of the physical layout of dimensions. `data-type` is a keyword that specifies one of the supported types of data, defined in [[`constants/dnnl-data-type`]] (`:float`, `:int`, etc.) `format` specifies an (optional) physical layout as a keyword, choosing one of [[`constants/dnnl-format`]] (`:nchw`, `:acdeb`, `:any`, etc.), or through strides specified as a Clojure vector of positive numbers that match logical dimensions. Examples: (memory-desc [2 3] :float :nc) (memory-desc [2 3 4 5] :float [120 3 4 5])
(multi-args src-and-dst)
(multi-args dst src)
(multi-args dst src0 src1)
(multi-args dst src0 src1 & srcs)
Creates DNNL's data structure that holds arguments for various operations that accept one destination and one or multiple sources.
Creates DNNL's data structure that holds arguments for various operations that accept one destination and one or multiple sources.
(ndims mem-desc)
Queries the number of dimensions of a memory descriptor.
Queries the number of dimensions of a memory descriptor.
(offset mem)
Gets the starting position in the buffer that the memory object mem
controls.
Gets the starting position in the buffer that the memory object `mem` controls.
(offset! mem n)
Sets the starting position in the buffer that the memory object mem
controls.
Sets the starting position in the buffer that the memory object `mem` controls.
(pooling-bwd eng
hint-fwd-pd
alg-kind
diff-src-desc
diff-dst-desc
kernel
strides
padding)
(pooling-bwd eng
hint-fwd-pd
alg-kind
diff-src-desc
diff-dst-desc
kernel
strides
dilates
padding)
(pooling-bwd eng
hint-fwd-pd
alg-kind
diff-src-desc
diff-dst-desc
kernel
strides
dilates
padding-l
padding-r)
TODO
TODO
(pooling-fwd eng prop-kind alg-kind src-desc dst-desc kernel strides padding)
(pooling-fwd eng
prop-kind
alg-kind
src-desc
dst-desc
kernel
strides
dilates
padding)
(pooling-fwd eng
prop-kind
alg-kind
src-desc
dst-desc
kernel
strides
dilates
padding-l
padding-r)
TODO
TODO
(primitive pd)
Creates a primitive from the primitive descriptor pd
.
Primitive encapsulates a pre-generated computation optimized for particular data shapes defined in the primitive descriptor. Usually, such primitive is executed many times with the data of these shapes, while the preparation cost is paid only at the time of creation.
Primitive is a function with execution context (state). In addition to immutable state such as input and output shape and data type, it could require a mutable temporary work memory buffer that is called scratchpad in DNNL terminology.
For more info about DNNL's concepts, see the official DNNL guide.
Creates a primitive from the primitive descriptor `pd`. Primitive encapsulates a pre-generated computation optimized for particular data shapes defined in the primitive descriptor. Usually, such primitive is executed many times with the data of these shapes, while the preparation cost is paid only at the time of creation. Primitive is a function with execution context (state). In addition to immutable state such as input and output shape and data type, it could require a mutable temporary work memory buffer that is called scratchpad in DNNL terminology. For more info about DNNL's concepts, see [the official DNNL guide](https://intel.github.io/mkl-dnn/dev_guide_basic_concepts.html).
(primitive-cache-capacity)
(primitive-cache-capacity! n)
(query-md pd what)
(query-md pd what index)
Queries the primitive descriptor pd
for the property what
and (optional) index index
.
Queries the primitive descriptor `pd` for the property `what` and (optional) index `index`.
(reduction eng alg-kind src dst)
(reduction eng alg-kind src dst p epsilon)
TODO
TODO
(reorder eng input output)
(reorder input-eng input output-eng output)
Copies data across engines, between physical memory formats, keeping the logical structure of the tensor.
Copies data across engines, between physical memory formats, keeping the logical structure of the tensor.
(softmax-bwd-args dst diff-dst diff-src)
(softmax-bwd-args src dst diff-dst diff-src)
Creates DNNL's data structure that holds arguments as required by softmax fwd and bwd operations.
Creates DNNL's data structure that holds arguments as required by softmax fwd and bwd operations.
(src-md pd)
Queries the primitive descriptor pd
for the source (input).
Queries the primitive descriptor `pd` for the source (input).
(stream eng & flags)
Creates a stream for executing primitive operations for engine eng
.
Stream execution can be further specified by flags
, defined in the
constants/dnnl-stream-flags
.
Stream has to be release
d.
Creates a stream for executing primitive operations for engine `eng`. Stream execution can be further specified by `flags`, defined in the [[constants/dnnl-stream-flags]]. Stream has to be `release`d.
(strides mem-desc)
Queries the strides of a memory descriptor.
Queries the strides of a memory descriptor.
(submemory-desc parent-desc dim)
(submemory-desc parent-desc dims offsets)
Creates a (sub)memory section of a memory object, using the specified
shape dims
, and offsets
vectors.
Creates a (sub)memory section of a memory object, using the specified shape `dims`, and `offsets` vectors.
(sum! eng scale dst)
(sum! eng dst scale src & scale-srcs)
Scales a single dst
, or sums scaled entries of more tensors elementwise.
This operation changes dst
. All sources and destinations have to be of
the same shape.
BEWARE: if dst
and one of the src
s are identical, this source has to
be the first src
argument, due to how DNNL algorithm works internally,
or result would be incorrect!
eng
: the computing context engine
scale
: a floating point scale for the first source
If only a single tensor is provided, computes dst = scale * dst.
dst
: the source and destination tensor
Otherwise, computes dst = scale * src + scale-srcs[0] * scale-srcs[1] etc.
dst
: the source and destination tensor
src
: the first source tensor
scale-srcs
: a sequence of scale1,
src1
, scale2
, src2
, etc.
Example: (sum eng md 2.0 md 3.0 md)
Scales a single `dst`, or sums scaled entries of more tensors elementwise. This operation changes `dst`. All sources and destinations have to be of the same shape. BEWARE: if `dst` and one of the `src`s are identical, this source has to be the first `src` argument, due to how DNNL algorithm works internally, or result would be incorrect! `eng`: the computing context engine `scale`: a floating point scale for the first source If only a single tensor is provided, computes dst = scale * dst. `dst`: the source and destination tensor Otherwise, computes dst = scale * src + scale-srcs[0] * scale-srcs[1] etc. `dst`: the source and destination tensor `src`: the first source tensor `scale-srcs`: a sequence of `scale1,` `src1`, `scale2`, `src2`, etc. Example: (sum eng md 2.0 md 3.0 md)
(vanilla-rnn-bwd eng
hint-fwd-pd
activation
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc
diff-src-desc
diff-src-iter-desc
diff-weights-desc
diff-weights-iter-desc
diff-bias-desc
diff-dst-desc
diff-dst-iter-desc)
(vanilla-rnn-bwd eng
hint-fwd-pd
activation
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc
diff-src-desc
diff-src-iter-desc
diff-weights-desc
diff-weights-iter-desc
diff-bias-desc
diff-dst-desc
diff-dst-iter-desc
alpha)
TODO
TODO
(vanilla-rnn-fwd eng
prop-kind
activation
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc)
(vanilla-rnn-fwd eng
prop-kind
activation
direction
src-desc
src-iter-desc
weights-desc
weights-iter-desc
bias-desc
dst-desc
dst-iter-desc
alpha)
TODO
TODO
(wait! strm)
Waits until stream s
completes execution of all queued operations.
Waits until stream `s` completes execution of all queued operations.
(weights-md pd)
Queries the primitive descriptor pd
for the weights.
Queries the primitive descriptor `pd` for the weights.
(workspace-md pd)
Queries the primitive descriptor pd
for the workspace (scratchpad).
Queries the primitive descriptor `pd` for the workspace (scratchpad).
(zero-desc? mem-desc)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close