3 #include <c10/core/Backend.h> 4 #include <c10/util/Exception.h> 9 enum class Layout : int8_t { Strided, Sparse };
11 constexpr
auto kStrided = Layout::Strided;
12 constexpr
auto kSparse = Layout::Sparse;
14 inline Layout layout_from_backend(
Backend backend) {
16 case Backend::SparseCPU:
17 case Backend::SparseCUDA:
18 case Backend::SparseHIP:
19 return Layout::Sparse;
21 return Layout::Strided;
25 inline std::ostream& operator<<(std::ostream& stream, at::Layout
layout) {
28 return stream <<
"Strided";
30 return stream <<
"Sparse";
32 AT_ERROR(
"Unknown layout");
Backend
This legacy enum class defines the set of backends supported by old school, code generated Type-based...
TensorOptions layout(Layout layout)
Convenience function that returns a TensorOptions object with the layout set to the given one...
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...