NEML2 2.0.0
|
Functions | |
template<> | |
bool | parse_ (bool &val, const std::string &raw_str) |
template<> | |
bool | parse_vector_ (std::vector< bool > &vals, const std::string &raw_str) |
template<> | |
bool | parse_ (VariableName &val, const std::string &raw_str) |
template<> | |
bool | parse_ (TensorShape &val, const std::string &raw_str) |
template<> | |
Device | parse (const std::string &raw_str) |
template<> | |
bool | parse_ (Device &val, const std::string &raw_str) |
TraceableTensorShape | extract_batch_sizes (const ATensor &tensor, Size batch_dim) |
Extract the batch shape of a tensor given batch dimension The extracted batch shape will be traceable. | |
std::shared_ptr< jit::Graph > | last_executed_optimized_graph () |
Print last evaluated optimized graph. | |
std::string | demangle (const char *name) |
Demangle a piece of cxx abi type information. | |
std::string | join (const std::vector< std::string > &strs, const std::string &delim) |
std::vector< std::string > | split (const std::string &str, const std::string &delims) |
std::string | trim (const std::string &str, const std::string &white_space) |
bool | start_with (std::string_view str, std::string_view prefix) |
bool | end_with (std::string_view str, std::string_view suffix) |
Size | storage_size (TensorShapeRef shape) |
The flattened storage size of a tensor with given shape. | |
TensorShape | pad_prepend (TensorShapeRef s, Size dim, Size pad=1) |
Pad shape s to dimension dim by prepending sizes of pad . | |
ATensor | pad_prepend (const ATensor &s, Size dim, Size pad) |
TraceableTensorShape | broadcast_batch_sizes (const std::vector< Tensor > &tensors) |
Find the broadcast batch shape of all the tensors The returned batch shape will be traceable. | |
template<typename T> | |
std::string | parse_failure_message (const std::string &raw_str) |
template<typename T> | |
bool | parse_ (T &val, const std::string &raw_str) |
template<typename T> | |
T | parse (const std::string &raw_str) |
template<typename T> | |
bool | parse_vector_ (std::vector< T > &vals, const std::string &raw_str) |
template<typename T> | |
std::vector< T > | parse_vector (const std::string &raw_str) |
template<typename T> | |
bool | parse_vector_vector_ (std::vector< std::vector< T > > &vals, const std::string &raw_str) |
template<typename T> | |
std::vector< std::vector< T > > | parse_vector_vector (const std::string &raw_str) |
template<> | |
bool | parse_< bool > (bool &, const std::string &raw_str) |
template<> | |
bool | parse_vector_< bool > (std::vector< bool > &, const std::string &raw_str) |
This special one is for the evil std::vector<bool>! | |
template<> | |
bool | parse_< TensorShape > (TensorShape &, const std::string &raw_str) |
template<> | |
bool | parse_< VariableName > (VariableName &, const std::string &raw_str) |
template<> | |
Device | parse< Device > (const std::string &raw_str) |
template<> | |
bool | parse_< Device > (Device &, const std::string &raw_str) |
template<typename... S> | |
TraceableTensorShape | add_traceable_shapes (const S &... shape) |
template<typename T, typename... Args> | |
void | stream_all (std::ostringstream &ss, T &&val, Args &&... args) |
template<typename T> | |
std::string | stringify (const T &t) |
template<> | |
std::string | stringify (const bool &t) |
template<class... T> | |
bool | broadcastable (const T &... tensors) |
template<class... T> | |
bool | batch_broadcastable (const T &... tensors) |
template<class... T> | |
bool | base_broadcastable (const T &... tensors) |
template<class... T> | |
Size | broadcast_batch_dim (const T &...) |
The batch dimension after broadcasting. | |
template<class... T> | |
bool | sizes_same (T &&... shapes) |
Check if all shapes are the same. | |
template<class... T> | |
bool | sizes_broadcastable (const T &... shapes) |
Check if the shapes are broadcastable. | |
template<class... T> | |
TensorShape | broadcast_sizes (const T &... shapes) |
Return the broadcast shape of all the shapes. | |
template<typename... S> | |
TensorShape | add_shapes (const S &...) |
template<class... T> | |
Size | broadcast_batch_dim (const T &... tensor) |
template<typename... S> | |
TensorShape | add_shapes (const S &... shape) |
TensorShape add_shapes | ( | const S &... | shape | ) |
TensorShape add_shapes | ( | const S & | ... | ) |
TraceableTensorShape add_traceable_shapes | ( | const S &... | shape | ) |
bool base_broadcastable | ( | const T &... | tensors | ) |
Test if the tensors are base-broadcastable.
bool batch_broadcastable | ( | const T &... | tensors | ) |
Test if the tensors are batch-broadcastable.
Size broadcast_batch_dim | ( | const T &... | tensor | ) |
Size broadcast_batch_dim | ( | const T & | ... | ) |
The batch dimension after broadcasting.
This should be as simple as the maximum batch_dim() among all arguments.
TraceableTensorShape broadcast_batch_sizes | ( | const std::vector< Tensor > & | tensors | ) |
Find the broadcast batch shape of all the tensors The returned batch shape will be traceable.
Pre-pad ones to the shapes
Braodcast
TensorShape broadcast_sizes | ( | const T &... | shapes | ) |
Return the broadcast shape of all the shapes.
bool broadcastable | ( | const T &... | tensors | ) |
Two tensors are said to be broadcastable if
std::string demangle | ( | const char * | name | ) |
Demangle a piece of cxx abi type information.
bool end_with | ( | std::string_view | str, |
std::string_view | suffix ) |
TraceableTensorShape extract_batch_sizes | ( | const ATensor & | tensor, |
Size | batch_dim ) |
Extract the batch shape of a tensor given batch dimension The extracted batch shape will be traceable.
std::string join | ( | const std::vector< std::string > & | strs, |
const std::string & | delim ) |
std::shared_ptr< jit::Graph > last_executed_optimized_graph | ( | ) |
Print last evaluated optimized graph.
TensorShape pad_prepend | ( | TensorShapeRef | s, |
Size | dim, | ||
Size | pad = 1 ) |
Pad shape s
to dimension dim
by prepending sizes of pad
.
s | The original shape to pad |
dim | The resulting dimension |
pad | The values used to pad the shape, default to 1 |
dim
T parse | ( | const std::string & | raw_str | ) |
Device parse | ( | const std::string & | raw_str | ) |
bool parse_ | ( | bool & | val, |
const std::string & | raw_str ) |
bool parse_ | ( | Device & | val, |
const std::string & | raw_str ) |
bool parse_ | ( | T & | val, |
const std::string & | raw_str ) |
bool parse_ | ( | TensorShape & | val, |
const std::string & | raw_str ) |
bool parse_ | ( | VariableName & | val, |
const std::string & | raw_str ) |
bool parse_< bool > | ( | bool & | , |
const std::string & | raw_str ) |
bool parse_< TensorShape > | ( | TensorShape & | , |
const std::string & | raw_str ) |
bool parse_< VariableName > | ( | VariableName & | , |
const std::string & | raw_str ) |
std::string parse_failure_message | ( | const std::string & | raw_str | ) |
std::vector< T > parse_vector | ( | const std::string & | raw_str | ) |
bool parse_vector_ | ( | std::vector< bool > & | vals, |
const std::string & | raw_str ) |
bool parse_vector_ | ( | std::vector< T > & | vals, |
const std::string & | raw_str ) |
bool parse_vector_< bool > | ( | std::vector< bool > & | , |
const std::string & | raw_str ) |
This special one is for the evil std::vector<bool>!
std::vector< std::vector< T > > parse_vector_vector | ( | const std::string & | raw_str | ) |
bool parse_vector_vector_ | ( | std::vector< std::vector< T > > & | vals, |
const std::string & | raw_str ) |
bool sizes_broadcastable | ( | const T &... | shapes | ) |
Check if the shapes are broadcastable.
Shapes are said to be broadcastable if, starting from the trailing dimension and iterating backward, the dimension sizes either are equal, one of them is 1, or one of them does not exist.
bool sizes_same | ( | T &&... | shapes | ) |
Check if all shapes are the same.
std::vector< std::string > split | ( | const std::string & | str, |
const std::string & | delims ) |
bool start_with | ( | std::string_view | str, |
std::string_view | prefix ) |
Size storage_size | ( | TensorShapeRef | shape | ) |
The flattened storage size of a tensor with given shape.
For example,
void stream_all | ( | std::ostringstream & | ss, |
T && | val, | ||
Args &&... | args ) |
|
inline |
std::string stringify | ( | const T & | t | ) |
std::string trim | ( | const std::string & | str, |
const std::string & | white_space ) |