Skip to content

Commit b494311

Browse files
committed
Clean up implementation and explicitly name vars
1 parent 4ba166e commit b494311

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/partitioning/shape_analysis.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ namespace partitioning {
1212
at::Tensor generateSingleInput(ir::Input& input, c10::optional<at::ScalarType>& type_opt) {
1313
auto cur_shape = input.input_shape;
1414
std::vector<int64_t> shape;
15+
16+
// Initialize min and max ranges for random number selection
17+
int LoValIncl = 0;
18+
int HiValExcl = 2;
19+
1520
shape.insert(shape.begin(), std::begin(cur_shape.d), std::begin(cur_shape.d) + cur_shape.nbDims);
1621

1722
auto type = at::kFloat;
@@ -20,7 +25,8 @@ at::Tensor generateSingleInput(ir::Input& input, c10::optional<at::ScalarType>&
2025
} else {
2126
LOG_WARNING("Input type for doing shape analysis could not be determined, defaulting to F32");
2227
}
23-
auto in = at::randint(2, shape, {at::kCUDA}).to(type);
28+
29+
auto in = at::randint(LoValIncl, HiValExcl, shape, {at::kCUDA}).to(type);
2430

2531
return in;
2632
}

0 commit comments

Comments
 (0)