Tensor< T > Struct Template Reference#
ck::Tensor< T > Struct Template Reference
#include <host_tensor.hpp>
Public Types | |
| using | Descriptor = HostTensorDescriptor |
| using | Data = std::vector< T > |
Public Member Functions | |
| template<typename X > | |
| Tensor (std::initializer_list< X > lens) | |
| template<typename X , typename Y > | |
| Tensor (std::initializer_list< X > lens, std::initializer_list< Y > strides) | |
| template<typename Lengths > | |
| Tensor (const Lengths &lens) | |
| template<typename Lengths , typename Strides > | |
| Tensor (const Lengths &lens, const Strides &strides) | |
| template<typename X , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0> | |
| Tensor (std::initializer_list< X > lens, Rest &&... rest) | |
| template<typename X , typename Y , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0> | |
| Tensor (std::initializer_list< X > lens, std::initializer_list< Y > strides, Rest &&... rest) | |
| template<typename Lengths , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0> | |
| Tensor (const Lengths &lens, Rest &&... rest) | |
| template<typename Lengths , typename Strides , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0> | |
| Tensor (const Lengths &lens, const Strides &strides, Rest &&... rest) | |
| Tensor (const Descriptor &desc) | |
| template<typename OutT > | |
| Tensor< OutT > | CopyAsType () const |
| Tensor ()=delete | |
| Tensor (const Tensor &)=default | |
| Tensor (Tensor &&)=default | |
| ~Tensor ()=default | |
| Tensor & | operator= (const Tensor &)=default |
| Tensor & | operator= (Tensor &&)=default |
| template<typename FromT > | |
| Tensor (const Tensor< FromT > &other) | |
| void | savetxt (std::string file_name, std::string dtype="float") |
| decltype(auto) | GetLengths () const |
| decltype(auto) | GetStrides () const |
| std::size_t | GetNumOfDimension () const |
| std::size_t | GetElementSize () const |
| std::size_t | GetElementSpaceSize () const |
| std::size_t | GetElementSpaceSizeInBytes () const |
| void | SetZero () |
| template<typename F > | |
| void | ForEach_impl (F &&f, std::vector< size_t > &idx, size_t rank) |
| template<typename F > | |
| void | ForEach (F &&f) |
| template<typename F > | |
| void | ForEach_impl (const F &&f, std::vector< size_t > &idx, size_t rank) const |
| template<typename F > | |
| void | ForEach (const F &&f) const |
| template<typename G > | |
| void | GenerateTensorValue (G g, std::size_t num_thread=1) |
| template<typename Distribution = std::uniform_real_distribution<float>, typename Mapping = ck::identity, typename Generator = std::minstd_rand> | |
| void | GenerateTensorDistr (Distribution dis={0.f, 1.f}, Mapping fn={}, const Generator g=Generator(0), std::size_t num_thread=-1) |
| template<typename... Is> | |
| std::size_t | GetOffsetFromMultiIndex (Is... is) const |
| template<typename... Is> | |
| T & | operator() (Is... is) |
| template<typename... Is> | |
| const T & | operator() (Is... is) const |
| T & | operator() (const std::vector< std::size_t > &idx) |
| const T & | operator() (const std::vector< std::size_t > &idx) const |
| Data::iterator | begin () |
| Data::iterator | end () |
| Data::pointer | data () |
| Data::const_iterator | begin () const |
| Data::const_iterator | end () const |
| Data::const_pointer | data () const |
| Data::size_type | size () const |
| template<typename U = T> | |
| auto | AsSpan () const |
| template<typename U = T> | |
| auto | AsSpan () |
Public Attributes | |
| Descriptor | mDesc |
| Data | mData |
Member Typedef Documentation
◆ Data
template<typename T >
| using ck::Tensor< T >::Data = std::vector<T> |
◆ Descriptor
template<typename T >
| using ck::Tensor< T >::Descriptor = HostTensorDescriptor |
Constructor & Destructor Documentation
◆ Tensor() [1/13]
template<typename T >
template<typename X >
|
inline |
◆ Tensor() [2/13]
template<typename T >
template<typename X , typename Y >
|
inline |
◆ Tensor() [3/13]
template<typename T >
template<typename Lengths >
|
inline |
◆ Tensor() [4/13]
template<typename T >
template<typename Lengths , typename Strides >
|
inline |
◆ Tensor() [5/13]
template<typename T >
template<typename X , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0>
|
inline |
◆ Tensor() [6/13]
template<typename T >
template<typename X , typename Y , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0>
|
inline |
◆ Tensor() [7/13]
template<typename T >
template<typename Lengths , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0>
|
inline |
◆ Tensor() [8/13]
template<typename T >
template<typename Lengths , typename Strides , typename... Rest, std::enable_if_t<(sizeof...(Rest) > 0), int > = 0>
|
inline |
◆ Tensor() [9/13]
template<typename T >
|
inline |
◆ Tensor() [10/13]
template<typename T >
|
delete |
◆ Tensor() [11/13]
template<typename T >
|
default |
◆ Tensor() [12/13]
template<typename T >
|
default |
◆ ~Tensor()
template<typename T >
|
default |
◆ Tensor() [13/13]
template<typename T >
template<typename FromT >
|
inlineexplicit |
Member Function Documentation
◆ AsSpan() [1/2]
◆ AsSpan() [2/2]
◆ begin() [1/2]
template<typename T >
|
inline |
◆ begin() [2/2]
template<typename T >
|
inline |
◆ CopyAsType()
template<typename T >
template<typename OutT >
|
inline |
◆ data() [1/2]
template<typename T >
|
inline |
◆ data() [2/2]
template<typename T >
|
inline |
◆ end() [1/2]
template<typename T >
|
inline |
◆ end() [2/2]
template<typename T >
|
inline |
◆ ForEach() [1/2]
template<typename T >
template<typename F >
|
inline |
◆ ForEach() [2/2]
◆ ForEach_impl() [1/2]
template<typename T >
template<typename F >
|
inline |
◆ ForEach_impl() [2/2]
template<typename T >
template<typename F >
|
inline |
◆ GenerateTensorDistr()
template<typename T >
template<typename Distribution = std::uniform_real_distribution<float>, typename Mapping = ck::identity, typename Generator = std::minstd_rand>
|
inline |
◆ GenerateTensorValue()
template<typename T >
template<typename G >
|
inline |
◆ GetElementSize()
template<typename T >
|
inline |
◆ GetElementSpaceSize()
template<typename T >
|
inline |
◆ GetElementSpaceSizeInBytes()
template<typename T >
|
inline |
◆ GetLengths()
template<typename T >
|
inline |
◆ GetNumOfDimension()
template<typename T >
|
inline |
◆ GetOffsetFromMultiIndex()
template<typename T >
template<typename... Is>
|
inline |
◆ GetStrides()
template<typename T >
|
inline |
◆ operator()() [1/4]
template<typename T >
|
inline |
◆ operator()() [2/4]
template<typename T >
|
inline |
◆ operator()() [3/4]
◆ operator()() [4/4]
template<typename T >
template<typename... Is>
|
inline |
◆ operator=() [1/2]
template<typename T >
|
default |
◆ operator=() [2/2]
template<typename T >
|
default |
◆ savetxt()
template<typename T >
|
inline |
◆ SetZero()
template<typename T >
|
inline |
◆ size()
template<typename T >
|
inline |
Member Data Documentation
◆ mData
template<typename T >
| Data ck::Tensor< T >::mData |
◆ mDesc
template<typename T >
| Descriptor ck::Tensor< T >::mDesc |
The documentation for this struct was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck/library/utility/host_tensor.hpp