This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestBatched.test_if_else_with_scalar.expect
50 lines (50 loc) · 1.9 KB
/
TestBatched.test_if_else_with_scalar.expect
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
graph(%a.1_data : Tensor
%a.1_mask : Tensor
%a.1_dims : Tensor
%b_data : Tensor
%b_mask : Tensor
%b_dims : Tensor) {
%6 : int = prim::Constant[value=1]()
%7 : float = prim::Constant[value=0.1]()
%8 : Float() = prim::NumToTensor(%7)
%other : float = prim::Float(%8)
%10 : Tensor = aten::gt(%a.1_data, %other)
%11 : Long() = prim::NumToTensor(%6)
%alpha.1 : float = prim::Float(%11)
%data.1 : Tensor = aten::add(%a.1_data, %b_data, %alpha.1)
%mask.1 : Tensor = aten::mul(%a.1_mask, %b_mask)
%dims.1 : Tensor = aten::__or__(%a.1_dims, %b_dims)
%16 : Long() = prim::NumToTensor(%6)
%alpha : float = prim::Float(%16)
%data : Tensor = aten::sub(%a.1_data, %b_data, %alpha)
%mask : Tensor = aten::mul(%a.1_mask, %b_mask)
%dims : Tensor = aten::__or__(%a.1_dims, %b_dims)
%21 : bool = prim::Constant[value=1]()
%22 : int = prim::Constant[value=1]()
%23 : Tensor = aten::type_as(%a.1_mask, %10)
%data.2 : Tensor = aten::mul(%10, %23)
%25 : int = aten::dim(%data.2)
%26 : bool = aten::eq(%25, %22)
%cond_data : Tensor, %cond_mask : Tensor = prim::If(%26)
block0() {
%29 : int = aten::dim(%data.1)
%30 : int = aten::sub(%29, %22)
%data.4 : Tensor = prim::Loop(%30, %21, %data.2)
block0(%32 : int, %33 : Tensor) {
%34 : int = aten::dim(%33)
%data.3 : Tensor = aten::unsqueeze(%33, %34)
-> (%21, %data.3)
}
%cond_data.1 : Tensor = aten::expand_as(%data.4, %data.1)
%cond_mask.1 : Tensor = aten::expand_as(%data.4, %mask.1)
-> (%cond_data.1, %cond_mask.1)
}
block1() {
-> (%data.2, %data.2)
}
%res_data : Tensor = aten::where(%cond_data, %data.1, %data)
%res_mask : Tensor = aten::where(%cond_mask, %mask.1, %mask)
%res_dims : Tensor = aten::__or__(%dims.1, %dims)
%41 : (Tensor, Tensor, Tensor) = prim::TupleConstruct(%res_data, %res_mask, %res_dims)
return (%41);
}