Skip to content

Commit

Permalink
Rewrote documentation to be closer to NumPy
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffburdick committed Jul 3, 2023
1 parent 02c43ea commit 2cfeb6b
Show file tree
Hide file tree
Showing 933 changed files with 190,157 additions and 38,679 deletions.
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_double.rst
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
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_float.rst
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
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_int16.rst
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
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_int32.rst
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
18 changes: 18 additions & 0 deletions docs/_sources/api/casting/as_int8.rst
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:

18 changes: 18 additions & 0 deletions docs/_sources/api/casting/as_type.rst
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:

8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_uint16.rst
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
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_uint32.rst
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
8 changes: 8 additions & 0 deletions docs/_sources/api/casting/as_uint8.rst
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
10 changes: 10 additions & 0 deletions docs/_sources/api/casting/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _casting_functions:

Casting Operators
#################

.. toctree::
:maxdepth: 2
:glob:

*
9 changes: 0 additions & 9 deletions docs/_sources/api/class.rst.txt

This file was deleted.

10 changes: 10 additions & 0 deletions docs/_sources/api/creation/index.rst
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
18 changes: 18 additions & 0 deletions docs/_sources/api/creation/operators/alternate.rst
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:

34 changes: 34 additions & 0 deletions docs/_sources/api/creation/operators/diag.rst
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:
19 changes: 19 additions & 0 deletions docs/_sources/api/creation/operators/eye.rst
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:

10 changes: 10 additions & 0 deletions docs/_sources/api/creation/operators/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _opcreate_functions:

Creation Operators
##################

.. toctree::
:maxdepth: 2
:glob:

*
20 changes: 20 additions & 0 deletions docs/_sources/api/creation/operators/linspace.rst
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:

20 changes: 20 additions & 0 deletions docs/_sources/api/creation/operators/logspace.rst
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:

18 changes: 18 additions & 0 deletions docs/_sources/api/creation/operators/meshgrid.rst
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:

19 changes: 19 additions & 0 deletions docs/_sources/api/creation/operators/ones.rst
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:

19 changes: 19 additions & 0 deletions docs/_sources/api/creation/operators/range.rst
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:

19 changes: 19 additions & 0 deletions docs/_sources/api/creation/operators/zeros.rst
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:

10 changes: 10 additions & 0 deletions docs/_sources/api/creation/tensors/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _tensorcreate_functions:

Tensor Creation
###############

.. toctree::
:maxdepth: 2
:glob:

*
42 changes: 42 additions & 0 deletions docs/_sources/api/creation/tensors/make.rst
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)
Loading

0 comments on commit 2cfeb6b

Please sign in to comment.