tvm
repr.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
27 #ifndef TVM_IR_REPR_H_
28 #define TVM_IR_REPR_H_
29 
30 #include <tvm/ffi/extra/dataclass.h>
31 #include <tvm/runtime/base.h>
32 
33 #include <iostream>
34 
35 namespace tvm {
36 
41 TVM_DLL void Dump(const ffi::ObjectRef& node);
42 
47 TVM_DLL void Dump(const ffi::Object* node);
48 
49 } // namespace tvm
50 
51 namespace tvm {
52 namespace ffi {
53 
54 // ostream << ObjectRef — delegates to ffi::ReprPrint
55 inline std::ostream& operator<<(std::ostream& os, const ObjectRef& n) { // NOLINT(*)
56  return os << ffi::ReprPrint(Any(n));
57 }
58 
59 // ostream << Any — delegates to ffi::ReprPrint
60 inline std::ostream& operator<<(std::ostream& os, const Any& n) { // NOLINT(*)
61  return os << ffi::ReprPrint(n);
62 }
63 
64 // ostream << Variant<...> — delegates to ffi::ReprPrint
65 template <typename... V>
66 inline std::ostream& operator<<(std::ostream& os, const ffi::Variant<V...>& n) { // NOLINT(*)
67  return os << ffi::ReprPrint(Any(n));
68 }
69 
70 } // namespace ffi
71 } // namespace tvm
72 #endif // TVM_IR_REPR_H_
std::ostream & operator<<(std::ostream &os, const ObjectRef &n)
Definition: repr.h:55
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
void Dump(const ffi::ObjectRef &node)
Dump the node to stderr, used for debug purposes.