This Shruti “अन्योऽसावन्योऽहमस्मीति न स वेद” is mentioned in Brihadaranyaka Upanishad 1.4.10
अन्योऽसावन्योऽहमस्मीति न स वेद !
पदच्छेद – अन्य असौ अन्य अहमस्मि इति न स वेद
Referring to Self Knowledge (Braham-Vidya) it is said that if a man worships another worldly deity, thinking: “He is one and I am another,” he does not know.
What doesn’t he know ? He doesn’t know his true nature as Brahman.
As highlighted in the Brihadaranyaka Upanishad 1.4.10 , the knower of self knowledge will become Brahman, whether he is a devata , rishi or man.