"""
+ if name in nameMap:
+ result = tmpl % [name & ".html", nameMap[name]]
+ else:
+ result = tmpl % [name & ".html", name]
+
+proc getHeaderMap(path: string): seq[seq[string]] =
+ ## returns a nesteed seq where each element is a `seq[string]` containing
+ ## all elements to be added to the header at the index. The index
+ ## corresponds to the `$N` of the `nimDocTemplates.headerTmpl` field.
+ const excludeFiles = [ "nn", # only imports and exports `NN` files
+ "nn_dsl", # only imports and exports `NN DSL` files
+ "ml", # only imports and exports `ML` files
+ "io", # only imports and exports `io` files
+ "autograd", # only imports and exports `autograd` files
+ "blis" # doesn't import or export anything
+ ]
+ let ExcludeFileSet = toSet(excludeFiles)
+ # map of the different header categories
+ let catMap = { "tensor" : 1,
+ "nn" : 2,
+ "nn_dsl" : 2,
+ "linear_algebra" : 3,
+ "stats" : 3,
+ "ml" : 3,
+ "datasets" : 4,
+ "io" : 4,
+ "autograd" : 5 ,
+ "nn_primitives" : 6,
+ "nlp" : 7,
+ "math_ops_fusion" : 7,
+ "laser" : 7,
+ "private" : 7}.toTable
+
+ # `indexOverride` is used to override the index of the header the file
+ # is added to. Some files may be part of e.g. `tensor` but shouldn't be
+ # listed there, since they aren't that important.
+ # NOTE: the elements here are ``filenames`` and ``not`` directories!
+ let indexOverride = { "global_config" : 7 }.toTable
+ let files = getFiles(path)
+
+ result = newSeq[seq[string]](7)
+ for file in files:
+ let baseName = file.extractFilename()
+ let outfile = baseName.replace(".nim", "")
+ if outfile in ExcludeFileSet: continue
+ let subDir = file.removePrefix(path).split('/')[0]
+ if subDir in catMap:
+ var idx: int
+ if outfile notin indexOverride:
+ idx = catMap[subDir] - 1
+ else:
+ idx = indexOverride[outfile] - 1
+ result[idx].add outfile
+
+proc genNimdocCfg*(path: string) =
+ ## This proc generates the `nimdoc.cfg`, which sits at the root of the
+ ## arraymancer repository. We generate it so that we can combine the
+ ## front page template derived from flyx's NimYaml: https://github.com/flyx/NimYAML
+ ## with the standard Nim document generation. We generate the fields for
+ ## the header links from the actual files found in each diretory.
+ ##
+ ## NOTE: manual intervention is required for each directory that is added
+ ## and should show up as its own tab in the header. Essentially look at the
+ ## `$` spans in the `docFileTmpl` above to see what to do.
+ let headerMap = getHeaderMap(path)
+ # create the strings based on the header map for each span
+ var spans = newSeq[string](7)
+ for idx in 0 ..< spans.len:
+ spans[idx] = headerMap[idx].sorted.mapIt(wrap(it)).join("\n")
+ # fill the HTML generation template from the filenames
+ let htmlTmpl = headerTmpl % [ spans[0], spans[1], spans[2],
+ spans[3], spans[4], spans[5],
+ spans[6]]
+ # first "header"
+ var fdata = ""
+ fdata.add("# Arraymancer documentation generation\n\n")
+ fdata.add(&"git.url = \"{gitUrl}\"\n\n")
+ fdata.add(&"doc.item.seesrc = \"\"\"{docItemSeeSrc}\"\"\"\n\n")
+ # finally write the HTML document template
+ fdata.add(&"doc.file = \"\"\"{docFileTmpl}{htmlTmpl}\"\"\"\n")
+
+ # now build the content for the spans
+ writeFile(getProjectPath() & $DirSep & "nimdoc.cfg", fdata)
diff --git a/docs/index.rst b/docs/index.rst
index b0ac76120..9354d1e44 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -144,7 +144,7 @@ Installation:
Nim is available in some Linux repositories and on Homebrew for macOS.
I however recommend installing Nim in your user profile via
-```choosenim`` `__. Once choosenim
+`choosenim `_. Once choosenim
installed Nim, you can ``nimble install arraymancer`` which will pull
arraymancer and all its dependencies.
diff --git a/docs/nav.css b/docs/nav.css
index 7efa28b2c..0a35153b0 100644
--- a/docs/nav.css
+++ b/docs/nav.css
@@ -77,6 +77,12 @@ header span ul.monospace a {
font-family: "Source Code Pro", Menlo, "Courier New", Courier, monospace;
}
+header span ul span ul {
+ max-height: 800px;/* you can change as you need it */
+ overflow:auto;/* to get scroll */
+}
+
+
header a:link,
header a:visited {
background: inherit;
diff --git a/docs/nimDocTemplates.nim b/docs/nimDocTemplates.nim
new file mode 100644
index 000000000..e3e463cac
--- /dev/null
+++ b/docs/nimDocTemplates.nim
@@ -0,0 +1,194 @@
+const gitUrl* = "https://github.com/mratsim/arraymancer"
+
+const docItemSeeSrc* = """ Source
+Edit
+"""
+
+# TODO: industrialize similar to Nim website: https://github.com/nim-lang/Nim/blob/e758b9408e8fe935117f7f793164f1c9b74cec06/tools/nimweb.nim#L45
+# And: https://github.com/nim-lang/Nim/blob/d3f966922ef4ddd05c137f82e5b2329b3d5dc485/web/website.ini#L31
+
+# TODO: move the technical reference to the end (need some CSS so that elements are properly placed)
+
+const docFileTmpl* = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+$title
+
+
+
+
+
+
+
+
+
+Arraymancer - $title
+
+
+
+
+
+
+
+
+
+
+
-
"""
diff --git a/src/laser/primitives/matrix_multiplication/gemm_prepacked.nim b/src/laser/primitives/matrix_multiplication/gemm_prepacked.nim
index 1f3a90584..9e8338d4c 100644
--- a/src/laser/primitives/matrix_multiplication/gemm_prepacked.nim
+++ b/src/laser/primitives/matrix_multiplication/gemm_prepacked.nim
@@ -298,8 +298,9 @@ proc gemm_packed*[T: SomeNumber](
#
# ############################################################
-when isMainModule:
-
+when false:
+ ## these tests don't work in arraymancer, since the imported files are not
+ ## part of arraymancer's repository.
import
../../tensor/[allocator, datatypes, initialization],
strformat
diff --git a/src/laser/primitives/matrix_multiplication/gemm_tiling.nim b/src/laser/primitives/matrix_multiplication/gemm_tiling.nim
index 0ccf3ecf4..a29cd3177 100644
--- a/src/laser/primitives/matrix_multiplication/gemm_tiling.nim
+++ b/src/laser/primitives/matrix_multiplication/gemm_tiling.nim
@@ -218,7 +218,7 @@ func x86_ukernel*(cpu: CPUFeatureX86, T: typedesc, c_unit_stride: bool): MicroKe
result.nb_vecs_nr = NbVecs[cpu] # SIMD vectors of B
result.nr = result.nb_vecs_nr * result.nb_scalars
-#############################################
+# #############################################
# Workaround "undeclared identifier mr or nr"
# for some reason the compiler cannot access fields in
# the static MicroKernel.
diff --git a/src/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim b/src/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim
index f6dc50058..a99afe5a0 100644
--- a/src/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim
+++ b/src/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim
@@ -188,10 +188,10 @@ macro ukernel_simd_impl*(
var declBody = newStmtList()
for a in rA:
declBody.add quote do:
- var `a`{.noinit.}: `V`
+ var `a`{.noInit.}: `V`
for b in rB:
declBody.add quote do:
- var `b`{.noinit.}: `V`
+ var `b`{.noInit.}: `V`
for i in 0 ..< MR:
for j in 0 ..< NbVecs:
let ab = rAB[i][j]
diff --git a/src/laser/primitives/matrix_multiplication/gemm_ukernel_sse2.nim b/src/laser/primitives/matrix_multiplication/gemm_ukernel_sse2.nim
index c6f844d5a..2ec32e034 100644
--- a/src/laser/primitives/matrix_multiplication/gemm_ukernel_sse2.nim
+++ b/src/laser/primitives/matrix_multiplication/gemm_ukernel_sse2.nim
@@ -25,11 +25,11 @@ ukernel_generator(
simd_fma = float64x2_muladd_unfused
)
-#######################################
+# #######################################
#
# Int32: hack to unroll scalar code
#
-#######################################
+# #######################################
# This is faster than using the fallback for mm_mullo_epi32
# in laser/primitives/private/sse2_utils
@@ -80,11 +80,11 @@ ukernel_generator(
)
-#######################################
+# #######################################
#
# Int64: hack to unroll scalar code
#
-#######################################
+# #######################################
type Int64x2 = array[2, int64]
diff --git a/src/linear_algebra/helpers/auxiliary_lapack.nim b/src/linear_algebra/helpers/auxiliary_lapack.nim
index 8ad74c913..e198105bd 100644
--- a/src/linear_algebra/helpers/auxiliary_lapack.nim
+++ b/src/linear_algebra/helpers/auxiliary_lapack.nim
@@ -167,6 +167,7 @@ proc ormqr*[T: SomeFloat](C: var Tensor[T], Q: Tensor[T], tau: openarray[T], sid
when isMainModule:
import ./decomposition_lapack
import ../../ml/metrics/common_error_functions
+ import ../../private/sequninit
let a = [[12.0, -51.0, 4.0],
[ 6.0, 167.0, -68.0],
diff --git a/src/linear_algebra/helpers/solve_lapack.nim b/src/linear_algebra/helpers/solve_lapack.nim
index 68ab1198c..3d38566c5 100644
--- a/src/linear_algebra/helpers/solve_lapack.nim
+++ b/src/linear_algebra/helpers/solve_lapack.nim
@@ -7,15 +7,15 @@ import
./overload,
../../tensor/tensor
-# Wrappers for Fortran LAPACK linear equation driver routines *SV
-# Currently only *GESV is wrapped
+# Wrappers for Fortran LAPACK linear equation driver routines `*SV`
+# Currently only `*GESV` is wrapped
# TODO: Implement GBSV, GTSV, POSV, PBSV, PTSV, SYSV
overload(gesv, sgesv)
overload(gesv, dgesv)
proc gesv*[T: SomeFloat](a, b: var Tensor[T], pivot_indices: var seq[int32]) =
- ## Wrapper for LAPACK *gesv routines
+ ## Wrapper for LAPACK `*gesv` routines
## Solve AX = B for general matrix
##
## In-place version, this will overwrite a and b
diff --git a/src/nn_primitives/backend/cudnn.nim b/src/nn_primitives/backend/cudnn.nim
index 211f8f49b..a57aa7a10 100644
--- a/src/nn_primitives/backend/cudnn.nim
+++ b/src/nn_primitives/backend/cudnn.nim
@@ -56,7 +56,7 @@ template asCudnnType*[T: SomeFloat](typ: typedesc[T]): cudnnDataType_t =
# #####################################################################
# Tensor descriptor
-proc newCudnn4DTensorDesc*[T: SomeFloat](t: CudaTensor[T]): cudnnTensorDescriptor_t {.inline, noinit.}=
+proc newCudnn4DTensorDesc*[T: SomeFloat](t: CudaTensor[T]): cudnnTensorDescriptor_t {.inline, noInit.}=
# TODO: destroy descriptor automatically
# TODO: generalize with the NDTensor Desc
check cudnnCreateTensorDescriptor(result.addr)
diff --git a/src/nn_primitives/backend/nnpack_interface.nim b/src/nn_primitives/backend/nnpack_interface.nim
index 1fd8fdf08..2defc6532 100644
--- a/src/nn_primitives/backend/nnpack_interface.nim
+++ b/src/nn_primitives/backend/nnpack_interface.nim
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import ../../tensor/tensor, ../types
+import ../../tensor/tensor, ../private/p_nnp_types
import ./nnpack
proc nnpack_conv2d*(input, weight, bias: Tensor[float32], padding, stride: Size2D): Tensor[float32] {.noInit.}= # TODO use a single convention, return value or var result
diff --git a/src/nn_primitives/nnp_maxpooling.nim b/src/nn_primitives/nnp_maxpooling.nim
index a6ff1e5d6..654d42a4c 100644
--- a/src/nn_primitives/nnp_maxpooling.nim
+++ b/src/nn_primitives/nnp_maxpooling.nim
@@ -21,7 +21,7 @@ proc maxpool2d*[T](input: Tensor[T],
kernel: Size2D,
padding: Size2D = (0,0),
stride: Size2D = (1,1)
- ): tuple[max_indices: Tensor[int], maxpooled: Tensor[T]] {.noinit.}=
+ ): tuple[max_indices: Tensor[int], maxpooled: Tensor[T]] {.noInit.}=
## MaxPool 2D forward pass
assert input.rank == 4 and input.is_C_contiguous
diff --git a/src/tensor/einsum.nim b/src/tensor/einsum.nim
index b414a407a..ad7cf6a37 100644
--- a/src/tensor/einsum.nim
+++ b/src/tensor/einsum.nim
@@ -4,163 +4,162 @@ import ./shapeshifting
# Note: importing shapeshifting_cuda will trigger a Nim inference bug
# in genContiguous with no workaround
-#[
-This module provides Einstein summation for an arbitrary number of tensors.
+## This module provides Einstein summation for an arbitrary number of tensors.
+##
+## Einstein summation describes a special application of
+## `index notation `_
+## in which indices that appear more than once are implicitly summed over.
+## This allows for a concise notation of many vector / matrix / tensor calculations,
+## while exactly representing the required calculation.
+##
+## In general Einstein summation is a subset of
+## `Ricci calculus `_.
+##
+## The implementation of `einsum` in different languages however, typically goes
+## above and beyond actual Einstein summation, allowing for many aspects of
+## Ricci calculus.
+##
+## Simple Einstein summation examples
+## ==================================
+##
+## Typical examples include matrix-vector multiplcation, matrix-matrix multiplication
+## or the cross product. The examples below use the `einsum` / notation for the
+## elements of tensors, namely `m[i,j]` for element `i,j` of the matrix ``m``, instead of
+## the more mathematical notation `m_ij`.
+##
+## Matrix-vector multiplication
+## ----------------------------
+##
+## Let ``m`` be an `NxM` matrix and ``v`` a `M` vector. Then matrix-vector multiplication
+## `m * v` is defined as:
+## `w[i] = \sum_j m[i,j] * v[j]`.
+## The result is an `N` vector ``w`` consisting of elements `w[i]`.
+## Since `j` appears twice on the RHS of the equation, Einstein summation implies that
+## the sum over `j` is implicit, hence we can write:
+##
+## `w[i] = m[i,j] * v[j]`.
+##
+## Matrix-matrix multiplication
+## ----------------------------
+##
+## The same can be applied to matrix-matrix multiplication. Let ``m``, ``n`` be two
+## compatible matrices (both `NxN` or `NxM` and `MxN`) with elements `m[i,j]` and
+## `n[i,j]`. Matrix-matrix multiplication is defined as
+##
+## `a[i,k] = \sum_j m[i,j] * n[j,k]`
+##
+## and thus in Einstein summation:
+##
+## `a[i,k] = m[i,j] * n[j,k]`.
+##
+## Cross-product of two vectors
+## ----------------------------
+##
+## The cross product of two 3 vectors ``v``, ``w`` can be conveniently defined using
+## the `Levi-Civita symbol `_
+## `\epsilon_{ijk}`:
+##
+## `a[i] = \epsilon_{ijk} v[j] * w[k]`,
+##
+## which implies `j` and `k` are summed over, while `i` is kept for the resulting tensor.
+##
+## More complex examples
+## =====================
+##
+## In this implementation of `einsum` (similar to other `einsum` implementations),
+## it's also possible to explicitly keep different dimensions of the multiplied
+## tensors or even perform calculations without a single index appearing mutliple
+## times, for instance to transpose a tensor. For these cases the explicit form
+## of the `einsum` macro has to be used, see below.
+##
+## Transposition of a matrix
+## -------------------------
+##
+## Transposition of a matrix can be expressed in index notation simply as an
+## exchange of indices, namely let ``m`` be an `NxM` matrix, the transposed
+## `MxN` matrix ``m^T`` is written as:
+##
+## `m[j,i] = m[i,j]`.
+##
+## Hadamard product
+## ----------------
+##
+## The Hadamard product defines the product of two `NxM` matrices ``n``, ``m``
+## in which the matrices are multiplied element wise. It is a good example
+## of the extension of `einsum` over standard Einstein summation:
+##
+## `a[i,j] = m[i,j] * n[i,j]`.
+##
+## Naive Einstein summation would demand a sum over both `i` and `j`, resulting
+## in a scalar on the LHS instead of another `NxM` matrix.
+##
+## Contracting a whole matrix
+## --------------------------
+##
+## Contraction of a full matrix describes summing all elements of a matrix
+## ``m``, resulting in a scalar `a`. It is expressed by:
+##
+## `a = m[i,i]`.
+##
+## The `einsum` macro
+## ==================
+##
+## The `einsum` macro provides two different usage paradigms.
+## * implicit <- normal Einstein summation
+## * explicit <- potential extended Einstein summation
+##
+## The macro takes a `varargs[Tensor]` and a single statement. It
+## returns a `Tensor[T]`, where `T` is deduced from the subtype of the
+## given tensors, if the result is not a scalar. For a scalar result
+## the return value is of type `T`. Note that the type of all given tensors
+## must match!
+##
+## The statement given to the macro is just a single line making use of
+## Einstein summation as in all the examples above. As a matter of fact
+## all examples above are valid statements for the `einsum` macro!
+##
+## Of course only tensors, which are given to the macro in the `varargs`
+## may be used in the statement.
+##
+## If only the `RHS` of the examples above are given, the required indices
+## for the resulting tensor are automatically calculated using pure Einstein
+## summation. Assuming `a`, `b` are two 2D arraymancer tensors , we could
+## express their matrix mutliplcation as
+##
+## .. code:: nim
+## let c = einsum(a, b):
+## a[i,j] * b[j,k]
+##
+## Of course the same can be written in explicit form:
+##
+## .. code:: nim
+## let c = einsum(a, b):
+## c[i,k] = a[i,j] * b[j,k]
+##
+## A few things must be noted here for the explicit case:
+## * the indices on the LHS are taken as "the truth"! Any index appearing here
+## will ``not`` be summed over.
+## * the order on the LHS is taken into account, allowing for transposing
+## dimensions.
+## * the identifier used on the LHS is arbitrary. It can match what the user assigns
+## to, but need not.
+##
+## For many more examples for typical applications, take a look at the test case
+## `<../../tests/tensor/test_einsum.nim>`_.
+##
+## Implementation details
+## ----------------------
+##
+## The macro calculates, which indices must be contracted and which remain in the
+## final tensor. For each appearing index (of either case) we create a for loop,
+## while the contracting for loops appear within the non contracting indices.
+##
+## The macro creates a `block`, in which the code is produced and returns the
+## temporary tensor used in it.
+##
+## It also forces the tensors into contiguous, row major form by creating
+## local copies with `asContiguous`.
-Einstein summation describes a special application of
-`index notation `_
-in which indices that appear more than once are implicitly summed over.
-This allows for a concise notation of many vector / matrix / tensor calculations,
-while exactly representing the required calculation.
-
-In general Einstein summation is a subset of
-`Ricci calculus `_.
-
-The implementation of `einsum` in different languages however, typically goes
-above and beyond actual Einstein summation, allowing for many aspects of
-Ricci calculus.
-
-Simple Einstein summation examples
-==================================
-
-Typical examples include matrix-vector multiplcation, matrix-matrix multiplication
-or the cross product. The examples below use the `einsum` / notation for the
-elements of tensors, namely `m[i,j]` for element `i,j` of the matrix ``m``, instead of
-the more mathematical notation `m_ij`.
-
-Matrix-vector multiplication
-----------------------------
-
-Let ``m`` be an `NxM` matrix and ``v`` a `M` vector. Then matrix-vector multiplication
-`m * v` is defined as:
-`w[i] = \sum_j m[i,j] * v[j]`.
-The result is an `N` vector ``w`` consisting of elements `w[i]`.
-Since `j` appears twice on the RHS of the equation, Einstein summation implies that
-the sum over `j` is implicit, hence we can write:
-
-`w[i] = m[i,j] * v[j]`.
-
-Matrix-matrix multiplication
-----------------------------
-
-The same can be applied to matrix-matrix multiplication. Let ``m``, ``n`` be two
-compatible matrices (both `NxN` or `NxM` and `MxN`) with elements `m[i,j]` and
-`n[i,j]`. Matrix-matrix multiplication is defined as
-
-`a[i,k] = \sum_j m[i,j] * n[j,k]`
-
-and thus in Einstein summation:
-
-`a[i,k] = m[i,j] * n[j,k]`.
-
-Cross-product of two vectors
-----------------------------
-
-The cross product of two 3 vectors ``v``, ``w`` can be conveniently defined using
-the `Levi-Civita symbol `_
-`\epsilon_{ijk}`:
-
-`a[i] = \epsilon_{ijk} v[j] * w[k]`,
-
-which implies `j` and `k` are summed over, while `i` is kept for the resulting tensor.
-
-More complex examples
-=====================
-
-In this implementation of `einsum` (similar to other `einsum` implementations),
-it's also possible to explicitly keep different dimensions of the multiplied
-tensors or even perform calculations without a single index appearing mutliple
-times, for instance to transpose a tensor. For these cases the explicit form
-of the `einsum` macro has to be used, see below.
-
-Transposition of a matrix
--------------------------
-
-Transposition of a matrix can be expressed in index notation simply as an
-exchange of indices, namely let ``m`` be an `NxM` matrix, the transposed
-`MxN` matrix ``m^T`` is written as:
-
-`m[j,i] = m[i,j]`.
-
-Hadamard product
-----------------
-
-The Hadamard product defines the product of two `NxM` matrices ``n``, ``m``
-in which the matrices are multiplied element wise. It is a good example
-of the extension of `einsum` over standard Einstein summation:
-
-`a[i,j] = m[i,j] * n[i,j]`.
-
-Naive Einstein summation would demand a sum over both `i` and `j`, resulting
-in a scalar on the LHS instead of another `NxM` matrix.
-
-Contracting a whole matrix
---------------------------
-
-Contraction of a full matrix describes summing all elements of a matrix
-``m``, resulting in a scalar `a`. It is expressed by:
-
-`a = m[i,i]`.
-
-The `einsum` macro
-==================
-
-The `einsum` macro provides two different usage paradigms.
-* implicit <- normal Einstein summation
-* explicit <- potential extended Einstein summation
-
-The macro takes a `varargs[Tensor]` and a single statement. It
-returns a `Tensor[T]`, where `T` is deduced from the subtype of the
-given tensors, if the result is not a scalar. For a scalar result
-the return value is of type `T`. Note that the type of all given tensors
-must match!
-
-The statement given to the macro is just a single line making use of
-Einstein summation as in all the examples above. As a matter of fact
-all examples above are valid statements for the `einsum` macro!
-
-Of course only tensors, which are given to the macro in the `varargs`
-may be used in the statement.
-
-If only the `RHS` of the examples above are given, the required indices
-for the resulting tensor are automatically calculated using pure Einstein
-summation. Assuming `a`, `b` are two 2D arraymancer tensors , we could
-express their matrix mutliplcation as
-
-.. code:: nim
- let c = einsum(a, b):
- a[i,j] * b[j,k]
-
-Of course the same can be written in explicit form:
-
-.. code:: nim
- let c = einsum(a, b):
- c[i,k] = a[i,j] * b[j,k]
-
-A few things must be noted here for the explicit case:
-* the indices on the LHS are taken as "the truth"! Any index appearing here
- will ``not`` be summed over.
-* the order on the LHS is taken into account, allowing for transposing
- dimensions.
-* the identifier used on the LHS is arbitrary. It can match what the user assigns
- to, but need not.
-
-For many more examples for typical applications, take a look at the test case
-`<../../tests/tensor/test_einsum.nim>`_.
-
-Implementation details
-----------------------
-
-The macro calculates, which indices must be contracted and which remain in the
-final tensor. For each appearing index (of either case) we create a for loop,
-while the contracting for loops appear within the non contracting indices.
-
-The macro creates a `block`, in which the code is produced and returns the
-temporary tensor used in it.
-
-It also forces the tensors into contiguous, row major form by creating
-local copies with `asContiguous`.
-]#
type
# enum which stores whether an `einsum` call is explicit `skAssign` (statement
diff --git a/src/tensor/fallback/legacy/blas_l3_gemm_macro_kernel.nim b/src/tensor/fallback/legacy/blas_l3_gemm_macro_kernel.nim
index eff49f9f4..572e0fe75 100644
--- a/src/tensor/fallback/legacy/blas_l3_gemm_macro_kernel.nim
+++ b/src/tensor/fallback/legacy/blas_l3_gemm_macro_kernel.nim
@@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import ../backend/openmp
-
proc gemm_macro_kernel[T](mc, nc, kc: int,
alpha: T,
beta: T,
@@ -58,4 +56,4 @@ proc gemm_macro_kernel[T](mc, nc, kc: int,
buffer_C,
1, MR,
C, i*MR*incRowC+j*NR*incColC + offC,
- incRowC, incColC)
\ No newline at end of file
+ incRowC, incColC)
diff --git a/src/tensor/fallback/legacy/blas_l3_gemm_micro_kernel.nim b/src/tensor/fallback/legacy/blas_l3_gemm_micro_kernel.nim
index 2932c9e20..b21fbd20a 100644
--- a/src/tensor/fallback/legacy/blas_l3_gemm_micro_kernel.nim
+++ b/src/tensor/fallback/legacy/blas_l3_gemm_micro_kernel.nim
@@ -13,7 +13,7 @@
# limitations under the License.
import macros,
- ../backend/memory_optimization_hints
+ ../../backend/memory_optimization_hints
macro unroll_ukernel[MRNR, T](AB: array[MRNR, T],
a: ptr UncheckedArray[T], offA: int,
diff --git a/src/tensor/private/p_kernels_interface_opencl.nim b/src/tensor/private/p_kernels_interface_opencl.nim
index 736fef7a4..4b9f7e5d7 100644
--- a/src/tensor/private/p_kernels_interface_opencl.nim
+++ b/src/tensor/private/p_kernels_interface_opencl.nim
@@ -126,11 +126,11 @@ template genClInfixOp*( T: typedesc,
export procName
template gen_cl_apply2*(kern_name, ctype, op: string): string =
- ## Generates an OpenCL kernel for an elementwise in-place binary infix operation (like +=, -=, *.= or /.=)
+ ## Generates an OpenCL kernel for an elementwise in-place binary infix operation (like `+=, -=, *.= or /.=`)
## Input:
## - The C type
## - The C kernel name (this only helps debugging the C code)
- ## - The C operation (+=, -=, *.= or /.=)
+ ## - The C operation (`+=, -=, *.= or /.=`)
opencl_getIndexOfElementID() & """
__kernel
@@ -165,13 +165,13 @@ template genClInPlaceOp*( T: typedesc,
cInfixOp: string,
exported: static[bool] = true): untyped =
## Generates an OpenCL kernel for an elementwise in-place binary
- ## infix operation (like +=, -=, *.= or /.=)
+ ## infix operation (like `+=, -=, *.= or /.=`)
## Input:
## - The Nim type of the elements of the input tensors
## - The equivalent C type
## - The Nim identifier of the resulting proc
## - The C kernel name (this only helps debugging the C code)
- ## - The C operation (+=, -=, *.= or /.=)
+ ## - The C operation (`+=, -=, *.= or /.=`)
proc procName(dst: var ClTensor[T], src: ClTensor[T]) =
when compileOption("boundChecks"):