[tensorboard] update assertion error for `scalar()` and fix docs (#76859)
Summary: title
Test Plan: unit test
Reviewed By: Reubend
Differential Revision: D35922397
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76859
Approved by: https://github.com/Reubend, https://github.com/ananthsub