If your product has attributes such as Color, Size etc and you wish to set stock at attribute level, you could set Quantity empty in the product Main tab and set proper stock number in Quantity column in Attributes tab. Then the stock is tracked solely by attribute quantity. If one attribute value is out of stock this value won't be displayed when customers try to choose the attribute.