Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix render issue in NDArray linalg docs (#14258)
Browse files Browse the repository at this point in the history
* fix render issue in docs

* nudge ci

* update copyright year; mostly for bumping ci

* bumping ci

* delete whitespace
  • Loading branch information
aaronmarkham authored and nswamy committed Apr 5, 2019
1 parent 8287656 commit f0cd148
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/operator/tensor/la_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* Copyright (c) 2019 by Contributors
* \file la_op.cc
* \brief CPU implementation of Operators for advanced linear algebra.
*/

#include "./la_op.h"
#include "./la_op-inl.h"

Expand All @@ -48,20 +49,19 @@ Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identit
matrix transposition (depending on *transpose_a*, *transpose_b*).
If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
parameter. By default, the trailing two dimensions will be used for matrix encoding.
For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent
to the following without the overhead of the additional swapaxis operations::
A1 = swapaxes(A, dim1=1, dim2=3)
B1 = swapaxes(B, dim1=1, dim2=3)
C = swapaxes(C, dim1=1, dim2=3)
C = gemm(A1, B1, C)
C = swapaxis(C, dim1=1, dim2=3)
without the overhead of the additional swapaxis operations.
When the input data is of type float32 and the environment variables MXNET_CUDA_ALLOW_TENSOR_CORE
and MXNET_CUDA_TENSOR_OP_MATH_ALLOW_CONVERSION are set to 1, this operator will try to use
pseudo-float16 precision (float32 math with float16 I/O) precision in order to use
Expand Down Expand Up @@ -126,19 +126,18 @@ Here *alpha* is a scalar parameter and *op()* is either the identity or the matr
transposition (depending on *transpose_a*, *transpose_b*).
If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
parameter. By default, the trailing two dimensions will be used for matrix encoding.
For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
the following without the overhead of the additional swapaxis operations::
A1 = swapaxes(A, dim1=1, dim2=3)
B1 = swapaxes(B, dim1=1, dim2=3)
C = gemm2(A1, B1)
C = swapaxis(C, dim1=1, dim2=3)
without the overhead of the additional swapaxis operations.
When the input data is of type float32 and the environment variables MXNET_CUDA_ALLOW_TENSOR_CORE
and MXNET_CUDA_TENSOR_OP_MATH_ALLOW_CONVERSION are set to 1, this operator will try to use
pseudo-float16 precision (float32 math with float16 I/O) precision in order to use
Expand Down Expand Up @@ -317,7 +316,6 @@ If *n>2*, *trmm* is performed separately on the trailing two dimensions for all
.. note:: The operator supports float32 and float64 data types only.
Examples::
// Single triangular matrix multiply
Expand Down

0 comments on commit f0cd148

Please sign in to comment.