-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote documentation to be closer to NumPy
- Loading branch information
1 parent
02c43ea
commit 2cfeb6b
Showing
933 changed files
with
190,157 additions
and
38,679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_double_func: | ||
|
||
as_double | ||
========= | ||
|
||
Cast an operator to a double | ||
|
||
.. doxygenfunction:: matx::as_double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_float_func: | ||
|
||
as_float | ||
========= | ||
|
||
Cast an operator to a float | ||
|
||
.. doxygenfunction:: matx::as_float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_int16_func: | ||
|
||
as_int16 | ||
======== | ||
|
||
Cast an operator to an int16_t | ||
|
||
.. doxygenfunction:: matx::as_int16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_int32_func: | ||
|
||
as_int32 | ||
========= | ||
|
||
Cast an operator to an int32_t | ||
|
||
.. doxygenfunction:: matx::as_int32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _as_int8_func: | ||
|
||
as_int8 | ||
======= | ||
|
||
Cast an operator to an int8_t | ||
|
||
.. doxygenfunction:: matx::as_int8 | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../test/00_operators/OperatorTests.cu | ||
:language: cpp | ||
:start-after: example-begin as_int8-test-1 | ||
:end-before: example-end as_int8-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _as_type_func: | ||
|
||
as_type | ||
======= | ||
|
||
Cast an operator to an arbitrary type | ||
|
||
.. doxygenfunction:: matx::as_type | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../test/00_operators/OperatorTests.cu | ||
:language: cpp | ||
:start-after: example-begin as_type-test-1 | ||
:end-before: example-end as_type-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_uint16_func: | ||
|
||
as_uint16 | ||
========= | ||
|
||
Cast an operator to an uint16_t | ||
|
||
.. doxygenfunction:: matx::as_uint16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_uint32_func: | ||
|
||
as_uint32 | ||
========= | ||
|
||
Cast an operator to an uint32_t | ||
|
||
.. doxygenfunction:: matx::as_uint32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _as_uint8_func: | ||
|
||
as_uint8 | ||
======== | ||
|
||
Cast an operator to an uint8_t | ||
|
||
.. doxygenfunction:: matx::as_uint8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _casting_functions: | ||
|
||
Casting Operators | ||
################# | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _opten_creating: | ||
|
||
Creating Operators and Tensors | ||
############################## | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
operators/index.rst | ||
tensors/index.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _alternate_func: | ||
|
||
alternate | ||
========= | ||
|
||
Generate an alternating sequence of +1, -1, +1, ... | ||
|
||
.. doxygenfunction:: matx::alternate(const index_t len) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin alternate-gen-test-1 | ||
:end-before: example-end alternate-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. _diag_func: | ||
|
||
diag | ||
==== | ||
|
||
`diag` comes in two forms: a generator and an operator. The generator version is used to generate a diagonal | ||
tensor with a given value, while the operator pulls diagonal elements from a tensor. | ||
|
||
Operator | ||
________ | ||
.. doxygenfunction:: matx::diag(T1 t) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin diag-op-test-1 | ||
:end-before: example-end diag-op-test-1 | ||
:dedent: | ||
|
||
Generator | ||
_________ | ||
|
||
.. doxygenfunction:: matx::diag(const index_t (&s)[RANK], T val) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin diag-gen-test-1 | ||
:end-before: example-end diag-gen-test-1 | ||
:dedent: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _eye_func: | ||
|
||
eye | ||
=== | ||
|
||
Generate an identity tensor | ||
|
||
.. doxygenfunction:: matx::eye(ShapeType &&s) | ||
.. doxygenfunction:: matx::eye(const index_t (&s)[RANK]) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin eye-gen-test-1 | ||
:end-before: example-end eye-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _opcreate_functions: | ||
|
||
Creation Operators | ||
################## | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _linspace_func: | ||
|
||
linspace | ||
======== | ||
|
||
Return a range of linearly-spaced numbers using first and last value. The step size is | ||
determined by the shape. | ||
|
||
.. doxygenfunction:: matx::linspace(ShapeType &&s, T first, T last) | ||
.. doxygenfunction:: matx::linspace(const index_t (&s)[RANK], T first, T last) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin linspace-gen-test-1 | ||
:end-before: example-end linspace-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _logspace_func: | ||
|
||
logspace | ||
======== | ||
|
||
Return a range of logarithmically-spaced numbers using first and last value. The step size is | ||
determined by the shape. | ||
|
||
.. doxygenfunction:: matx::logspace(ShapeType &&s, T first, T last) | ||
.. doxygenfunction:: matx::logspace(const index_t (&s)[RANK], T first, T last) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin logspace-gen-test-1 | ||
:end-before: example-end logspace-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.. _meshgrid_func: | ||
|
||
meshgrid | ||
========= | ||
|
||
Creates a matrix with values from two vectors | ||
|
||
.. doxygenfunction:: matx::meshgrid(Ts&&... ts) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin meshgrid-gen-test-1 | ||
:end-before: example-end meshgrid-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _ones_func: | ||
|
||
ones | ||
==== | ||
|
||
Generate an operator of ones | ||
|
||
.. doxygenfunction:: matx::ones(ShapeType &&s) | ||
.. doxygenfunction:: matx::ones(const index_t (&s)[RANK]) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin ones-gen-test-1 | ||
:end-before: example-end ones-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _range_func: | ||
|
||
range | ||
===== | ||
|
||
Return a range of numbers using a start and step value. The total length is based on the shape | ||
|
||
.. doxygenfunction:: matx::range(ShapeType &&s, T first, T step) | ||
.. doxygenfunction:: matx::range(const index_t (&s)[RANK], T first, T step) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin range-gen-test-1 | ||
:end-before: example-end range-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _zeros_func: | ||
|
||
zeros | ||
===== | ||
|
||
Generate an operator of zeros | ||
|
||
.. doxygenfunction:: matx::zeros(ShapeType &&s) | ||
.. doxygenfunction:: matx::zeros(const index_t (&s)[RANK]) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/GeneratorTests.cu | ||
:language: cpp | ||
:start-after: example-begin zeros-gen-test-1 | ||
:end-before: example-end zeros-gen-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _tensorcreate_functions: | ||
|
||
Tensor Creation | ||
############### | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.. _make_tensor: | ||
|
||
Making Tensors | ||
============== | ||
|
||
`make_tensor` is a utility function for creating tensors. Where possible, using `make_tensor` is preferred over | ||
directly declaring a `tensor_t` since it allows the tensor type to change in the future without breaking. See :ref:`creating` | ||
for a detailed walkthrough on creating tensors. | ||
|
||
`make_tensor` provides numerous overloads for different arguments and use cases: | ||
|
||
Return by Value | ||
~~~~~~~~~~~~~~~ | ||
|
||
.. doxygenfunction:: make_tensor( const index_t (&shape)[RANK], matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, const index_t (&shape)[TensorType::Rank()], matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( ShapeType &&shape, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::shape_container &&shape, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( T *data, const index_t (&shape)[RANK], bool owning = false) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::scalar_type *data, const index_t (&shape)[TensorType::Rank()], bool owning = false) | ||
.. doxygenfunction:: make_tensor( T *data, ShapeType &&shape, bool owning = false) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::scalar_type *data, typename TensorType::shape_container &&shape, bool owning = false) | ||
.. doxygenfunction:: make_tensor( T *ptr, bool owning = false) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::scalar_type *ptr, bool owning = false) | ||
.. doxygenfunction:: make_tensor( Storage &&s, ShapeType &&shape) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::storage_type &&s, typename TensorType::shape_container &&shape) | ||
.. doxygenfunction:: make_tensor( T* const data, D &&desc, bool owning = false) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::scalar_type* const data, typename TensorType::desc_type &&desc, bool owning = false) | ||
.. doxygenfunction:: make_tensor( D &&desc, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( TensorType &&tensor, typename TensorType::desc_type &&desc, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor( T *const data, const index_t (&shape)[RANK], const index_t (&strides)[RANK], bool owning = false) | ||
.. doxygenfunction:: make_tensor( TensorType &tensor, typename TensorType::scalar_type *const data, const index_t (&shape)[TensorType::Rank()], const index_t (&strides)[TensorType::Rank()], bool owning = false) | ||
|
||
Return by Pointer | ||
~~~~~~~~~~~~~~~~~ | ||
.. doxygenfunction:: make_tensor_p( const index_t (&shape)[RANK], matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor_p( ShapeType &&shape, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor_p( TensorType &tensor, typename TensorType::shape_container &&shape, matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor_p( matxMemorySpace_t space = MATX_MANAGED_MEMORY, cudaStream_t stream = 0) | ||
.. doxygenfunction:: make_tensor_p( T *const data, ShapeType &&shape, bool owning = false) |
Oops, something went wrong.