Is torch.tile deprecated & no longer supported?

username: Nich_010
cooked: <p>Hi, I’m currently attempting to re-implement a Tensorflow project using PyTorch. For reference, I’m currently utilizing the following virtual environment setup for the project:</p>
<ul>
<li>OS: Pop_OS 18.04 (Ubuntu 18.04 derivative)</li>
<li>Python version: 3.6.9</li>
<li>PyTorch version: 1.7.1+cu10</li>
<li>CUDA version : 11.1</li>
</ul>
<p>Unfortunately, I’ve encountered a problem in re-implementing one of the code lines, which called for use of <code>tf.tile</code>(<a href="https://www.tensorflow.org/api_docs/python/tf/tile" rel="noopener nofollow ugc">link</a> to Tensorflow’s documentation on tf.tile) in the original Tensorflow project.</p>
<p>I’ve noted that in one <a href="https://pytorch.org/docs/master/generated/torch.tile.html#torch.tile" rel="noopener nofollow ugc">page</a> of PyTorch’s official documentation, that a similar <code>torch.tile</code> functionality seem to be available, hence I decided to try and utilize this. However, whenever I call this method, I always encounter the following error instead:</p>
<pre><code class="lang-auto">&gt;&gt;&gt; import torch
&gt;&gt;&gt; test_tensor = torch.tensor([1,2,3,4])
&gt;&gt;&gt; test_tensor.tile((2,))
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'Tensor' object has no attribute 'tile'
&gt;&gt;&gt; 
</code></pre>
<p>Please do note that the same error still occurs even if I call the <code>tile</code> as a function applied on the created Tensor object, as seen below:</p>
<pre><code class="lang-auto">&gt;&gt;&gt; import torch
&gt;&gt;&gt; test_tensor = torch.tensor([1,2,3,4])
&gt;&gt;&gt; torch.tile(test_tensor, (2,2))
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: module 'torch' has no attribute 'tile'

</code></pre>
<p>Looking at similar posts of unable to call some specific PyTorch methods, I thought that perhaps there was a problem with the PyTorch implementation with my machine specifically which caused this issue. Hence, I then tried to call the same function in a different machine which this time has the following Virtual Environment config:</p>
<ul>
<li>OS: Pop_OS 20.04 (Ubuntu 20.04 derivative)</li>
<li>Python version: 3.8.5</li>
<li>PyTorch version: 1.6.0</li>
<li>CUDA version:</li>
</ul>
<p>Unfortunately, I was still met with the exact same error as the original machine, which made me think that <code>tile</code> has been deprecated as per title. May I confirm with anyone whether this is true, and if yes: why the PyTorch’s documentation has not yet been updated with this deprecation?</p>
<p>In the meantime I understand that the <code>tile</code> function could be effectively replaced in functionality by the similar <code>Tensor.repeat</code> method, so I’ll be using that for now. However, I’d just like to have a confirmation/clarification on the errors/behaviors that I’ve encountered on <code>torch.tile</code> .</p>
<p>Thank you for any replies or confirmation in advance!</p>

username: KFrank
cooked: <p>Hello Nicholas!</p>
<aside class="quote no-group" data-username="Nich_010" data-post="1" data-topic="108436" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/n/45deac/48.png" class="avatar"> Nich_010:</div>
<blockquote>
<pre><code class="lang-auto">AttributeError: module 'torch' has no attribute 'tile'
</code></pre>
</blockquote>
</aside>
<p>I think you have it backwards.  Rather than being deprecated, it<br>
appears that <code>tile()</code> is a new function.</p>
<p>I see <code>tile()</code> absent from the <a href="https://pytorch.org/docs/1.7.0/torch.html" rel="noopener nofollow ugc">1.7.0 documentation</a>, but present in the<br>
master (unstable) documentation you linked to.</p>
<p>Here is <code>tile()</code> in a somewhat old nightly build:</p>
<pre><code class="lang-plaintext">&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.__version__
'1.8.0.dev20201203'
&gt;&gt;&gt; torch.tile
&lt;built-in method tile of type object at 0x7f6626fc1360&gt;
</code></pre>
<p>If <code>tile()</code> is useful to you, you could consider running a nightly build<br>
(at a little bit of risk).  Or stick with <code>repeat()</code> for the time being, it that<br>
works for you.</p>
<p>Best.</p>
<p>K. Frank</p>

username: Nich_010
cooked: <p>Ah apologies I didn’t realize that the version I linked was that of an unreleased build myself! Thank you very much for the clarification and apologies on my part for not noticing! In that case I’ll be sticking with <code>repeat</code> for now then and avoid installing the nightly for now since my project requires stable functionality as much as possible.</p>
<p>Quite excited to try out the tile &amp; other new functions that will be released in the future versions of torch though, and will definitely try them later for myself!</p>

username: Vijayabhaskar_J
cooked: <p>I’m getting</p>
<pre><code class="lang-auto">AttributeError: module 'torch' has no attribute 'tile'
</code></pre>
<p>I’m on version 1.7.0, it seems it is missing from docs as <a class="mention" href="/u/kfrank">@KFrank</a> pointed out. I’m still confused was it deprecated?</p>

username: ptrblck
cooked: <p>No, as <a class="mention" href="/u/kfrank">@KFrank</a> explained, this is a new function, which is not available in <code>1.7.0</code>, but in the current master branch and nightly binaries.</p>