File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -12,16 +12,24 @@ namespace partitioning {
12
12
at::Tensor generateSingleInput (ir::Input& input, c10::optional<at::ScalarType>& type_opt) {
13
13
auto cur_shape = input.input_shape ;
14
14
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
+
15
20
shape.insert (shape.begin (), std::begin (cur_shape.d ), std::begin (cur_shape.d ) + cur_shape.nbDims );
16
- // auto type_opt = types[input.first][i];
21
+
17
22
auto type = at::kFloat ;
18
23
if (type_opt) {
19
24
type = type_opt.value ();
20
25
} else {
21
26
LOG_WARNING (" Input type for doing shape analysis could not be determined, defaulting to F32" );
22
27
}
23
- auto in = at::randint (5 , shape, {at::kCUDA }).to (type);
24
- // ivalue_map[input.first] = in.clone();
28
+
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 = ((HiValExcl - LoValIncl) * at::rand (shape, {at::kCUDA }) + LoValIncl).to (type);
32
+
25
33
return in;
26
34
}
27
35
You can’t perform that action at this time.
0 commit comments