Skip to content

Commit 8f41d83

Browse files
committed
Make default partitioning tensor input to uniform float range
- Perform casting to desired datatype after selecting a float from the range [0, 2)
1 parent b494311 commit 8f41d83

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/partitioning/shape_analysis.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ at::Tensor generateSingleInput(ir::Input& input, c10::optional<at::ScalarType>&
2626
LOG_WARNING("Input type for doing shape analysis could not be determined, defaulting to F32");
2727
}
2828

29-
auto in = at::randint(LoValIncl, HiValExcl, shape, {at::kCUDA}).to(type);
29+
// Make the value range for input tensor a uniform (float) distribution
30+
// over [LoValIncl, HiValExcl), then cast to the desired dtype
31+
auto in = ((LoValIncl - HiValExcl) * at::rand(shape, {at::kCUDA}) + HiValExcl).to(type);
3032

3133
return in;
3234
}

0 commit comments

Comments
 (0)