<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>y-kamiya</author_name>
  <author_url>https://blog.hatena.ne.jp/y-kamiya/</author_url>
  <blog_title>MEMOcho-</blog_title>
  <blog_url>https://jsapachehtml.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>pytorch</anon>
  </categories>
  <description>Double DQNの実装に必要になるちょっとした計算についてメモ ２つの２次元tensor x, yを用意し、&quot;xの各行において最大の値を持つ要素&quot;と同じ位置にあるyの要素を取得する &gt;&gt;&gt; x = torch.rand(3,5) &gt;&gt;&gt; x tensor([[ 0.0778, 0.6633, 0.4953, 0.1461, 0.4691], [ 0.3024, 0.0295, 0.3526, 0.6040, 0.7512], [ 0.1778, 0.7783, 0.1738, 0.5278, 0.0372]]) &gt;&gt;&gt; x.argmax(1) tensor([ 1, 4, 1]) &gt;&gt;&gt; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjsapachehtml.hatenablog.com%2Fentry%2F2018%2F08%2F26%2F142527&quot; title=&quot;pytorchでindexのリストを指定してtensorの要素を取得 - MEMOcho-&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-08-26 14:25:27</published>
  <title>pytorchでindexのリストを指定してtensorの要素を取得</title>
  <type>rich</type>
  <url>https://jsapachehtml.hatenablog.com/entry/2018/08/26/142527</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
