Skip to content

Commit ec2a2b0

Browse files
committed
- lints
1 parent 754c111 commit ec2a2b0

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/printer/doc.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ TVM_REGISTER_OBJECT_TYPE(DocTextNode);
5252

5353
class DocText : public DocAtom {
5454
public:
55-
explicit DocText(std::string str) {
56-
data_ = runtime::make_object<DocTextNode>(str);
57-
}
55+
explicit DocText(std::string str) { data_ = runtime::make_object<DocTextNode>(str); }
5856

5957
TVM_DEFINE_OBJECT_REF_METHODS(DocText, DocAtom, DocTextNode);
6058
};

src/support/scalars.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@ std::pair<FloatImm, bool> ValueToFloatImm(double value, int width) {
206206
}
207207

208208
} // namespace support
209-
} // namespace tvm
209+
} // namespace tvm

src/support/scalars.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#ifndef TVM_SUPPORT_SCALARS_H_
2626
#define TVM_SUPPORT_SCALARS_H_
2727

28+
#include <string>
29+
#include <utility>
30+
2831
#include "tvm/ir/expr.h"
2932
#include "tvm/relay/expr.h"
3033
#include "tvm/runtime/ndarray.h"
@@ -60,4 +63,4 @@ std::pair<FloatImm, bool> ValueToFloatImm(double value, int width);
6063
} // namespace support
6164
} // namespace tvm
6265

63-
#endif // TVM_SUPPORT_SCALARS_H_
66+
#endif // TVM_SUPPORT_SCALARS_H_

tests/python/relay/test_ir_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def test_int_literal():
189189
parse_text("2147483648i32")
190190
parse_text("32768i16")
191191

192+
192193
def test_float_literal():
193194
assert get_scalar(parse_text("1.0f")) == 1.0
194195
assert isclose(get_scalar(parse_text("1.56667f")), 1.56667)

tests/python/relay/test_ir_text_printer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ def show(text):
4646
print("---------------------------")
4747
print(text)
4848

49+
4950
def assert_prints_as(expr, str):
5051
assert astext(expr) == SEMVER + str
5152

53+
5254
def test_scalars():
5355
assert_prints_as(relay.const(42, "int16"), "42i16")
5456
assert_prints_as(relay.const(42, "int32"), "42")
@@ -57,6 +59,7 @@ def test_scalars():
5759
assert_prints_as(relay.const(3.0, "float32"), "3f")
5860
assert_prints_as(relay.const(3.0, "float64"), "3f64")
5961

62+
6063
def test_large_graph():
6164
x = relay.var("x", shape=(3, 2))
6265
y = relay.var("y")

0 commit comments

Comments
 (0)