Is it immoral/ethically wrong [...]
To start, you need to understand what do morals and ethics mean.
There are multiple definitions of morals, but in general, we can agree that morals are informal rules that govern social interactions, with the goal of (at least) improving common wellbeing. For example, "do not kill" is a moral rule that protects the group wellbeing.
In more extreme conceptions, morals could be not only a mechanism to improve wellbeing, but even to improve the survival probabilities of a group (I personally sustain this position). For example, "do not kill" in such context, directly improves the group's survival probabilities. "Be kind" contributes to better interactions, which implies increased survival probabilities (perhaps infinitesimally, yes, but it is a positive increment).
In any case, morals are informal rules that govern social interactions. Informal essentially means that are transmitted via oral communication, and it is the dialectic counterpart of formal, which means positive, written, registered. Ethics are the formal counterpart of morals.
[...] to torture an AI [...]
Torture implies an act that produces pain. Pain only can be suffered by an entity if it has a nervous system that allows it to experience an equivalent to human pain. How would you produce pain to a carburator or a lubricant? Anyway...
This understanding of the behavior of entities that are not human is called humanization. We cannot even be sure that pain can be felt by an entity that has no consciousness, like a dog. Worst even, by shoes or graphical processing unit computational cards.
[...] that thinks it's human?
Computers don't think. Thinking is exclusive to humans. Computers just compute, otherwise they will be called "thinkers". Thinking implies understanding, processing a sensitive experience upon a metaphysical foundation of knowledge. A computer does not "think" it is human: it just prints a message. Anyway...
So, what you are asking is moreover...
- Is it wrong for social wellbeing/survival/etc...
- ... to inflict what you understand as hardware or software pain...
- ... on a machine that computes...
- ... and it is capable of printing "I am human"?
As you see, the question is largely biased and has no sense at all.