Warren Buffett's Berkshire Hathaway (BRK.A 0.74%) (BRK.B 0.97%) has shied away from all but two tech stocks: Apple (AAPL -1.14%) and International Business Machine (IBM 0.14%). The Oracle of Omaha has famously said that he isn't keen on investing in big-cap tech names because their operations can be confusing. "If there's lots of technology, we won't understand it," he said.

But according to SEC filings, Buffet's holding company owns 130 million shares of Apple, valued at about $20 billion, and 54 million shares of IBM, valued at $7.9 billion.

Apple is currently valued at about $790 billion vs. IBM's $135 billion. Apple's stock price has risen about 60% since Buffet took a stake in it, but IBM's share price has fallen about 10%. "I thought it would do better in the six years that have elapsed than it has," Buffett said of IBM at Berkshire's annual meeting in May.

Berkshire Hathaway CEO Warren Buffett

Berkshire Hathaway CEO Warren Buffett has increased his position in Apple in 2017 while decreasing his position in IBM. Image Source: The Motley Fool.

However, while IBM's performance hasn't been especially impressive, it has a current 4.13% dividend yield vs. Apple's 1.64% dividend yield. Apple restarted its dividend yield in 2012.

IBM became a part of Berkshire's portfolio back in 2011 and was a surprise to investors who had known Buffett to avoid tech names. At the time, Buffett said he was impressed with the company after seeing how its services can be used in IT departments at companies.

However, Buffett cut his stake in IBM by about 30% in the first half of 2017, from 81 million shares to about 54 million shares. IBM's stock has reflected the tough transition the company has been in as it shifts its focus from traditional hardware to artificial intelligence and cloud computing.

Buffett even took a dig at IBM on CNBC to show how much he liked Apple in comparison. "I still don't know that much about [IBM's] future, but I feel more certain about the future as I look at a company like Apple than when I look at IBM now," he said.

Berkshire first invested 9.8 million shares in Apple in the first quarter of 2016 when the stock was trading in the low $100s. By the end of 2016, Buffett had about 61.2 million shares of Apple, purchased between the low $100s and about $120. Finally, in early 2017, Buffett nearly doubled his stake in Apple to about 130 million shares, bought at prices between $116 and $122. Apple now trades at $153.39.

During Berkshire's annual meeting, Buffett said Apple is in a better position than IBM because its products have more stickiness. "I think Apple is much more of a consumer-products business," he said. But he noted that only time will tell if his second tech stock pick turns out better than his first.

When Buffett, who has admitted to not owning an iPhone, was asked on CNBC in February about why he now had a 2.5% stake in Apple. He simply said, "Because I like it." Buffett said he thinks Apple will be the first company to reach a $1 trillion valuation. 

While Buffett seems happy with the nearly $7 billion he has made off of Apple in the past year-and-a-half, he also admitted that he "blew it" by not investing in Alphabet or Amazon. Buffett said that he was "too dumb" to realize that Amazon would be able to expand to such a large scale, and he thought its shares seemed expensive. "I did not think [CEO Jeff Bezos] could succeed on the scale he has," he said.

While the jury is still out on IBM, Apple has some big products due out before year-end that should help boost the stock. The iPhone 8, larger iPhone 8 Plus, and Apple Watch Series 3 ship out Sept. 22, and the fully redesigned iPhone X ships out Oct. 27. In addition, Apple's answer to the Amazon Echo, known as the Apple HomePod, is expected to ship out in December in time for the holidays.

In other words, Buffett is in for a particularly joyous holiday season.