Skip to content

print() and @show for intermediate results #245

@SubhadityaMukherjee

Description

@SubhadityaMukherjee

For some reason, outputs do not display when it comes to loops.
Say I have this code. I followed the instructions are removed @info but it only prints to console and not here. Is there a workaround or am I doing something wrong? Since this is a local variable I cant even bind it to display elsewhere...

#Package used "OpenAIGym"
begin
	global s
	for i  1:20
	  T = 0
	  R = run_episode(env, RandomPolicy()) do (s, a, r, s′)
	    #render(env)
	    T += 1
	  end
		R2 = R
	  "Episode $i finished after $T steps. Total reward: $R" #Need this to display here 
	end
	close(env)
end

On the other hand something like this works.

begin 
	temp = "123"
	temp
end

PS. I love this package. ❤️

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions