Caffe2 - C++ API
A deep learning, cross platform ML framework
Formatting.h
1 #pragma once
2 
3 #include <c10/core/Scalar.h>
4 #include <ATen/core/Tensor.h>
5 #include <ATen/core/TensorMethods.h>
6 #include <ATen/core/Type.h>
7 #include <iostream>
8 
9 
10 namespace c10 {
11 CAFFE2_API std::ostream& operator<<(std::ostream& out, Backend b);
12 }
13 namespace at {
14 
15 CAFFE2_API std::ostream& operator<<(std::ostream& out, const Type& t);
16 CAFFE2_API std::ostream& print(
17  std::ostream& stream,
18  const Tensor& tensor,
19  int64_t linesize);
20 static inline std::ostream& operator<<(std::ostream & out, const Tensor & t) {
21  return print(out,t,80);
22 }
23 static inline void print(const Tensor & t, int64_t linesize=80) {
24  print(std::cout,t,linesize);
25 }
26 
27 static inline std::ostream& operator<<(std::ostream & out, Scalar s) {
28  return out << (s.isFloatingPoint() ? s.toDouble() : s.toLong());
29 }
30 
31 }
Backend
This legacy enum class defines the set of backends supported by old school, code generated Type-based...
Definition: Backend.h:23
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Definition: alias_info.h:7
Flush-To-Zero and Denormals-Are-Zero mode.