<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Memory Model - Tag - MartinLwx&#39;s Blog</title>
        <link>https://martinlwx.github.io/en/tags/memory-model/</link>
        <description>Memory Model - Tag - MartinLwx&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>martinlwx@163.com (MartinLwx)</managingEditor>
            <webMaster>martinlwx@163.com (MartinLwx)</webMaster><copyright>&lt;a rel=&#34;license noopener&#34; href=&#34;https://creativecommons.org/licenses/by-nc-nd/4.0/&#34; target=&#34;_blank&#34;&gt;CC BY-NC-ND 4.0&lt;/a&gt;</copyright><lastBuildDate>Fri, 14 Jul 2023 15:22:02 &#43;0800</lastBuildDate><atom:link href="https://martinlwx.github.io/en/tags/memory-model/" rel="self" type="application/rss+xml" /><item>
    <title>Demystifying PyTorch&#39;s Strides Format</title>
    <link>https://martinlwx.github.io/en/how-to-reprensent-a-tensor-or-ndarray/</link>
    <pubDate>Fri, 14 Jul 2023 15:22:02 &#43;0800</pubDate><author>
        <name>MartinLwx</name>
    </author><guid>https://martinlwx.github.io/en/how-to-reprensent-a-tensor-or-ndarray/</guid>
    <description><![CDATA[<h2 id="intro" class="headerLink">
    <a href="#intro" class="header-mark"></a>Intro</h2><p>Even though I have been using Numpy and PyTorch for a long time, I never really knew how they implemented the underlying tensors and why they are <em>so efficient</em>. Recently, while studying the course <a href="https://dlsyscourse.org/" target="_blank" rel="noopener noreferrer">Deep Learning Systems</a>, I finally got the opportunity to try implementing tensors on my own. After going through the process, my understanding of tensors is much better 🧐</p>
<p>As a PyTorch user, is it necessary to understand the underlying tensor storage mechanism? I believe <em>it is essential</em>. In most cases, understanding the underlying principles helps you grasp higher-level concepts better. For example, understanding the tensor storage mechanism can help you answer the following questions:</p>]]></description>
</item><item>
    <title>System programming: stack and heap</title>
    <link>https://martinlwx.github.io/en/what-is-the-heap-and-stack/</link>
    <pubDate>Mon, 19 Sep 2022 19:01:04 &#43;0800</pubDate><author>
        <name>MartinLwx</name>
    </author><guid>https://martinlwx.github.io/en/what-is-the-heap-and-stack/</guid>
    <description><![CDATA[<h2 id="intro" class="headerLink">
    <a href="#intro" class="header-mark"></a>Intro</h2><p>If you&rsquo;ve been using dynamic languages like Python, JavaScript, etc., you probably won&rsquo;t notice the difference between stack and heap. Because these languages have garbage collectors (GCs) that will automatically manage memory for you, you just need to program at a high level without considering the details. The bad news is that GC is not a cost-free design. No matter how well-designed a GC algorithm is, the performance of the code will be degraded to some extent. If you have been in programming for a long time, you may have heard something like &ldquo;the recursion explodes the stack&rdquo;. You may or may not click on the search engine to understand the difference between stack and heap. Chances are you just clicked into this article :)</p>]]></description>
</item></channel>
</rss>
