}
}
+void print(const Tensor & t, int64_t linesize) {
+ print(std::cout,t,linesize);
+}
std::ostream& print(std::ostream& stream, const Tensor & tensor_, int64_t linesize) {
FormatGuard guard(stream);
if(!tensor_.defined()) {
#include <c10/core/Scalar.h>
#include <ATen/core/Tensor.h>
-#include <iostream>
+#include <ostream>
namespace c10 {
static inline std::ostream& operator<<(std::ostream & out, const Tensor & t) {
return print(out,t,80);
}
-static inline void print(const Tensor & t, int64_t linesize=80) {
- print(std::cout,t,linesize);
-}
+TORCH_API void print(const Tensor & t, int64_t linesize=80);
static inline std::ostream& operator<<(std::ostream & out, Scalar s) {
if (s.isFloatingPoint()) {
#include <ATen/core/Vitals.h>
#include <cstdlib>
+#include <iostream>
namespace at {
namespace vitals {
#pragma once
#include <cstring>
-#include <iostream>
#include <map>
#include <memory>
+#include <ostream>
#include <sstream>
#include <unordered_map>
#include <ATen/core/function_schema.h>
+#include <iostream>
+
namespace c10 {
void FunctionSchema::dump() const {
#include <cstdint>
#include <cstring>
-#include <iostream>
#include <mutex>
-#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
#include <c10/util/StringUtil.h>
#include <c10/util/hash.h>
#include <cmath>
+#include <iostream>
namespace c10 {
bool _fastEqualsForContainer(const IValue& lhs, const IValue& rhs) {
#include <c10/util/TypeList.h>
#include <c10/util/Optional.h>
-#include <iostream>
+#include <array>
#include <memory>
+#include <ostream>
+#include <sstream>
#include <type_traits>
-#include <array>
struct ClassType;
namespace torch {
#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <iostream>
+#include <ostream>
namespace at {
namespace vec {
#include <ATen/cpu/vec/intrinsics.h>
#include <ATen/cpu/vec/vec_base.h>
#include <c10/macros/Macros.h>
+#include <iostream>
namespace at {
namespace vec {
#include <c10/util/quint8.h>
#include <array>
+#include <iostream>
// This file defines Vectorized<> for the quantized types.
//
#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <iostream>
#include <type_traits>
#if AT_MKL_ENABLED() && !defined(__APPLE__)
#include <ATen/ATen.h>
-#include <ostream>
+#include <iostream>
#include <sstream>
namespace at { namespace native {
#include <ATen/miopen/Descriptors.h>
#include <ATen/ATen.h>
+#include <iostream>
+
namespace at { namespace native {
namespace {
#pragma once
#include <cstdint>
-#include <iostream>
#include <memory>
#include <vector>
#include <cassert>
#endif
uint32_t col_block_size; // input features block size
uint32_t row_block_size; // output features block size
- void print() {
- std::cout << "row block size:" << row_block_size << std::endl;
- std::cout << "col block size:" << col_block_size << std::endl;
- std::cout << "row ptr\n";
- for (const auto& t : row_values) {
- std::cout << t << ", ";
- }
- std::cout << std::endl;
- std::cout << "col indices\n";
- for (const auto& t : col_indices) {
- std::cout << t << ", ";
- }
- std::cout << std::endl;
- std::cout << "Actual values\n";
- for (const auto& t : values) {
- std::cout << (uint32_t)t << ", ";
- }
- std::cout << std::endl;
- }
+ void print() const;
} BCSRMatrix;
std::unique_ptr<BCSRMatrix> generateBlockCSRMatrix(
* LICENSE file in the root directory of this source tree.
*/
#include <cassert>
+#include <iostream>
#include <pack_block_sparse.h>
bcsr_mat.col_block_size = col_block_size;
return bcsr_mat_ptr;
}
+
+void BCSRMatrix::print() const {
+ std::cout << "row block size:" << row_block_size << std::endl;
+ std::cout << "col block size:" << col_block_size << std::endl;
+ std::cout << "row ptr\n";
+ for (const auto& t : row_values) {
+ std::cout << t << ", ";
+ }
+ std::cout << std::endl;
+ std::cout << "col indices\n";
+ for (const auto& t : col_indices) {
+ std::cout << t << ", ";
+ }
+ std::cout << std::endl;
+ std::cout << "Actual values\n";
+ for (const auto& t : values) {
+ std::cout << (uint32_t)t << ", ";
+ }
+ std::cout << std::endl;
+}
} // namsepace qnnpack
#include <c10/macros/Macros.h>
#include <c10/util/ArrayRef.h>
#include <c10/util/Exception.h>
-#include <iostream>
+#include <ostream>
#include <string>
#include <vector>
#include <c10/core/Backend.h>
#include <c10/util/Exception.h>
-#include <iostream>
+#include <ostream>
namespace c10 {
enum class Layout : int8_t { Strided, Sparse, SparseCsr, Mkldnn, NumOptions };
#include <c10/util/ArrayRef.h>
#include <c10/util/Exception.h>
-#include <iostream>
+#include <ostream>
// Memory format is not the property of a Tensor. It is the way to tell an
// operator how the result should be organized in memory and nothing more. That
#include <complex>
#include <cstdint>
-#include <iostream>
+#include <ostream>
namespace c10 {
#include <c10/macros/Macros.h>
#include <c10/util/C++17.h>
#include <c10/util/Optional.h>
-#include <iostream>
#if defined(_MSC_VER)
#include <intrin.h>
#endif
#pragma once
#include <complex>
-#include <iostream>
#include <c10/macros/Macros.h>
#include <c10/macros/Macros.h>
#include <c10/util/C++17.h>
#include <c10/util/Optional.h>
-#include <iostream>
namespace c10 {
/**
#include <cassert>
#include <complex>
#include <cstdlib>
-#include <iostream>
#include <memory>
#include <mutex>
#include <type_traits>
#include "caffe2/core/scope_guard.h"
#include <iomanip>
+#include <iostream>
#include <mutex>
C10_DEFINE_bool(
#include "caffe2/core/operator.h"
#include <algorithm>
+#include <iostream>
#include "caffe2/core/init.h"
#include "caffe2/core/logging.h"
}
}
+DeviceTypeRegisterer::DeviceTypeRegisterer(DeviceType type, RegistryFunction func) {
+ if (gDeviceTypeRegistry()->count(type)) {
+ std::cerr << "Device type " << DeviceTypeName(type)
+ << "registered twice. This should not happen. Did you have "
+ "duplicated numbers assigned to different devices?";
+ std::exit(1);
+ }
+ // Calling the registry function to get the actual registry pointer.
+ gDeviceTypeRegistry()->emplace(type, func());
+}
+
unique_ptr<OperatorBase> CreateOperator(
const OperatorDef& operator_def,
Workspace* ws,
TORCH_API std::map<DeviceType, OperatorRegistry*>* gDeviceTypeRegistry();
struct TORCH_API DeviceTypeRegisterer {
- explicit DeviceTypeRegisterer(DeviceType type, RegistryFunction func) {
- if (gDeviceTypeRegistry()->count(type)) {
- std::cerr << "Device type " << DeviceTypeName(type)
- << "registered twice. This should not happen. Did you have "
- "duplicated numbers assigned to different devices?";
- std::exit(1);
- }
- // Calling the registry function to get the actual registry pointer.
- gDeviceTypeRegistry()->emplace(type, func());
- }
+ explicit DeviceTypeRegisterer(DeviceType type, RegistryFunction func);
};
#if defined(_MSC_VER)
#include "caffe2/core/operator_schema.h"
#include "caffe2/core/logging.h"
+#include <iostream>
+
#include <c10/util/irange.h>
namespace caffe2 {
return out;
}
+OpSchema& OpSchemaRegistry::NewSchema(const string& key, const string& file, const int line) {
+ auto& m = map();
+ auto it = m.find(key);
+ if (it != m.end()) {
+ const auto& schema = it->second;
+ std::ios_base::Init init;
+ std::cerr << "Trying to register schema with name " << key
+ << " from file " << file << " line " << line
+ << ", but it is already registered from file " << schema.file()
+ << " line " << schema.line();
+ abort();
+ }
+ m.emplace(key, OpSchema(key, file, line));
+ return m[key];
+}
+
CaffeMap<string, OpSchema>& OpSchemaRegistry::map() {
static CaffeMap<string, OpSchema> map;
return map;
class TORCH_API OpSchemaRegistry {
public:
static OpSchema&
- NewSchema(const string& key, const string& file, const int line) {
- auto& m = map();
- auto it = m.find(key);
- if (it != m.end()) {
- const auto& schema = it->second;
- std::ios_base::Init init;
- std::cerr << "Trying to register schema with name " << key
- << " from file " << file << " line " << line
- << ", but it is already registered from file " << schema.file()
- << " line " << schema.line();
- abort();
- }
- m.emplace(key, OpSchema(key, file, line));
- return m[key];
- }
+ NewSchema(const string& key, const string& file, const int line);
static const OpSchema* Schema(const string& key) {
auto& m = map();
#include "caffe2/operators/utility_ops.h"
#include <cmath>
+#include <iostream>
#include "caffe2/utils/eigen_utils.h"
namespace caffe2 {