Skip to content

Commit 43cc8d2

Browse files
committed
Updated test for embed self id
1 parent a0eb1b1 commit 43cc8d2

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

test/operations/hello_world_op.ml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -782,18 +782,16 @@ let%expect_test "Very big tensor" =
782782
in
783783
let%op hey = embed_self_id () in
784784
let%op hoo = embed_self_id () in
785-
(* let%op bar = hoo + hey + embed_self_id () in *)
785+
let%op bar = hoo + hey + embed_self_id () in
786786
Train.set_hosted hey.value;
787787
Train.set_hosted hoo.value;
788-
(* Train.set_hosted bar.value; *)
789-
ignore (Train.forward_once backend hey);
790-
ignore (Train.forward_once backend hoo);
791-
(* ignore (Train.forward_once backend bar); *)
788+
Train.set_hosted bar.value;
789+
ignore (Train.forward_once backend bar);
792790
Train.printf ~here:[%here] ~with_code:false ~with_grad:false hey;
793791
Train.printf ~here:[%here] ~with_code:false ~with_grad:false hoo;
794-
(* Train.printf ~here:[%here] ~with_code:false ~with_grad:false bar; *)
792+
Train.printf ~here:[%here] ~with_code:false ~with_grad:false bar;
795793
[%expect {|
796-
HERE: test/operations/hello_world_op.ml:792:23
794+
HERE: test/operations/hello_world_op.ml:790:23
797795
┌─────────────────────────┐
798796
│[0]: !@self_id shape 0:1
799797
│┌┬──────┐ │
@@ -802,7 +800,7 @@ let%expect_test "Very big tensor" =
802800
│││ 0.00 │ │
803801
│└┴──────┘ │
804802
└─────────────────────────┘
805-
HERE: test/operations/hello_world_op.ml:793:23
803+
HERE: test/operations/hello_world_op.ml:791:23
806804
┌─────────────────────────┐
807805
│[1]: !@self_id shape 0:1
808806
│┌┬──────┐ │
@@ -811,5 +809,24 @@ let%expect_test "Very big tensor" =
811809
│││ 1.00 │ │
812810
│└┴──────┘ │
813811
└─────────────────────────┘
814-
|}]
812+
HERE: test/operations/hello_world_op.ml:792:23
813+
┌─────────────────────┐
814+
│[4]: +_bar shape 0:1
815+
│┌┬──────┐ │
816+
│││axis 0│ │
817+
│├┼──────┤ │
818+
│││ 3.00 │ │
819+
│└┴──────┘ │
820+
└─────────────────────┘
821+
|}];
822+
Train.printf_tree ~here:[%here] bar;
823+
[%expect {|
824+
HERE: test/operations/hello_world_op.ml:822:30
825+
#4 +_bar
826+
3.00
827+
#3 + Virt/40 │#2 !@self_id Virt/40
828+
<void><void>
829+
#1 !@self_id│#0 !@self_id│
830+
1.000.00
831+
|}]
815832

0 commit comments

Comments
 (0)