No; poems are products of imagination and express beliefs that may not be the writer's, so that readers should not assume that the author is the speaker of the poem.
"Song of Myself" is a poem by Walt Whitman (1819-1892) that appears in his work Leaves of Grass. The poem is written in free verse style.
In "Song of Myself," Whitman highlights an all-powerful "I" which is the narrator, and who should not be confused with the person of the historical Walt Whitman.