Your device type is explicitly encoded in the user-agent string. Compare these UAs:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1
Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
In this example
iPhone idicates, well, an iPhone, and
SCH-I535 is the model number of a Galaxy S3. Consequently, if you change the UA to a custom string, most websites will identify you as a different device. However, there are also many advanced device fingerprinting techniques which are potentially less accurate but also harder to block.
if I own a Mac, does using TOR along with a proxy protecting me from a website like Gmail finding the type of device I am using?
The Tor browser aims for a design that minimizes possibilites for device fingerprinting. However, it can't stop everything. For example, if you're running the browser in full-screen mode, you're giving away your device's screen resolution. You can read the Tor browser docs chapter on fingerprinting for an extensive list of what exact measures they take.