{"id":76,"date":"2025-08-22T06:26:43","date_gmt":"2025-08-21T21:26:43","guid":{"rendered":"https:\/\/ik1-221-80670.vs.sakura.ne.jp\/wordpress\/archives\/76"},"modified":"2025-08-22T06:26:43","modified_gmt":"2025-08-21T21:26:43","slug":"%e3%83%86%e3%83%b3%e3%82%bd%e3%83%ab%e3%81%a8%e3%81%af%e4%bd%95%e3%81%a7%e3%81%99%e3%81%8b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.marchboy.xyz\/wordpress\/archives\/76","title":{"rendered":"\u30c6\u30f3\u30bd\u30eb\u3068\u306f\u4f55\u3067\u3059\u304b\uff1f"},"content":{"rendered":"<h2>\u30c6\u30f3\u30bd\u30eb\u3068\u306f\uff1f<\/h2>\n<p><strong>\u30c6\u30f3\u30bd\u30eb\uff08Tensor\uff09<\/strong> \u3068\u306f\u3001<strong>\u591a\u6b21\u5143\u914d\u5217\uff08multi-dimensional array\uff09<\/strong> \u306e\u3053\u3068\u3067\u3059\u3002\u6570\u5b66\u7684\u306b\u306f\u300c\u30d9\u30af\u30c8\u30eb\u3084\u884c\u5217\u3092\u3055\u3089\u306b\u62e1\u5f35\u3057\u305f\u3082\u306e\u300d\u3068\u8003\u3048\u308b\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<hr \/>\n<h2>\u6b21\u5143\u3054\u3068\u306e\u30a4\u30e1\u30fc\u30b8<\/h2>\n<ul>\n<li><strong>\u30b9\u30ab\u30e9\u30fc\uff080\u6b21\u5143\uff09<\/strong><br \/>\n\u5358\u4e00\u306e\u6570\u5024<br \/>\n\u4f8b: <code>3.14<\/code><\/p>\n<\/li>\n<li>\n<p><strong>\u30d9\u30af\u30c8\u30eb\uff081\u6b21\u5143\u30c6\u30f3\u30bd\u30eb\uff09<\/strong><br \/>\n\u6570\u5024\u306e\u4e26\u3073\uff081\u5217\uff09<br \/>\n\u4f8b: <code>[1, 2, 3]<\/code><\/p>\n<\/li>\n<li>\n<p><strong>\u884c\u5217\uff082\u6b21\u5143\u30c6\u30f3\u30bd\u30eb\uff09<\/strong><br \/>\n2\u6b21\u5143\u306e\u8868\u5f62\u5f0f\u30c7\u30fc\u30bf<br \/>\n\u4f8b:<\/p>\n<pre><code>[[1, 2, 3],\n[4, 5, 6]]\n<\/code><\/pre>\n<\/li>\n<li><strong>3\u6b21\u5143\u30c6\u30f3\u30bd\u30eb<\/strong><br \/>\n\u884c\u5217\u3092\u4f55\u679a\u3082\u91cd\u306d\u305f\u3082\u306e\uff08\u753b\u50cf\u306eRGB\u30c1\u30e3\u30f3\u30cd\u30eb\u306a\u3069\uff09<br \/>\n\u4f8b:<\/p>\n<pre><code>[[[1,2,3],\n[4,5,6]],\n[[7,8,9],\n[10,11,12]]]\n<\/code><\/pre>\n<\/li>\n<li><strong>n\u6b21\u5143\u30c6\u30f3\u30bd\u30eb<\/strong><br \/>\n\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3067\u306f4\u6b21\u5143\uff08\u30d0\u30c3\u30c1 \u00d7 \u30c1\u30e3\u30f3\u30cd\u30eb \u00d7 \u9ad8\u3055 \u00d7 \u5e45\uff09\u30845\u6b21\u5143\u306a\u3069\u3082\u3057\u3070\u3057\u3070\u767b\u5834\u3057\u307e\u3059\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>PyTorch\u3067\u306e\u30c6\u30f3\u30bd\u30eb\u4f8b<\/h2>\n<pre><code class=\"language-python\">import torch\n\n# \u30b9\u30ab\u30e9\u30fc\uff080\u6b21\u5143\uff09\na = torch.tensor(5)\n\n# \u30d9\u30af\u30c8\u30eb\uff081\u6b21\u5143\uff09\nb = torch.tensor([1, 2, 3])\n\n# \u884c\u5217\uff082\u6b21\u5143\uff09\nc = torch.tensor([[1, 2, 3], [4, 5, 6]])\n\n# 3\u6b21\u5143\u30c6\u30f3\u30bd\u30eb\uff08\u4f8b\uff1a\u753b\u50cf\u30c7\u30fc\u30bf\uff09\nd = torch.rand(3, 64, 64)  # \u30c1\u30e3\u30f3\u30cd\u30eb3, \u9ad8\u305564, \u5e4564\n<\/code><\/pre>\n<hr \/>\n<h2>\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3068\u30c6\u30f3\u30bd\u30eb<\/h2>\n<p>\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3067\u306f\u3001\u5165\u529b\u30c7\u30fc\u30bf\u3084\u30e2\u30c7\u30eb\u306e\u91cd\u307f\u3001\u8a08\u7b97\u7d50\u679c\u306a\u3069\u3059\u3079\u3066\u3092\u30c6\u30f3\u30bd\u30eb\u3067\u6271\u3044\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u753b\u50cf\u306f <code>[\u30d0\u30c3\u30c1\u30b5\u30a4\u30ba, \u30c1\u30e3\u30f3\u30cd\u30eb, \u9ad8\u3055, \u5e45]<\/code> \u3068\u3044\u3046 <strong>4\u6b21\u5143\u30c6\u30f3\u30bd\u30eb<\/strong> \u3067\u8868\u3055\u308c\u307e\u3059\u3002<\/p>\n<hr \/>\n<h2>\u307e\u3068\u3081<\/h2>\n<ul>\n<li>\u30c6\u30f3\u30bd\u30eb\u306f <strong>\u591a\u6b21\u5143\u914d\u5217<\/strong> \u306e\u3053\u3068  <\/li>\n<li>\u30d9\u30af\u30c8\u30eb\u3084\u884c\u5217\u306e\u6982\u5ff5\u3092\u4e00\u822c\u5316\u3057\u305f\u3082\u306e  <\/li>\n<li>PyTorch\u3067\u306f\u30c6\u30f3\u30bd\u30eb\u3092\u4e2d\u5fc3\u306b\u30c7\u30fc\u30bf\u3092\u6271\u3046<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30f3\u30bd\u30eb\u3068\u306f\uff1f \u30c6\u30f3\u30bd\u30eb\uff08Tensor\uff09 \u3068\u306f\u3001\u591a\u6b21\u5143\u914d\u5217\uff08multi-dimensional array\uff09 \u306e\u3053\u3068\u3067\u3059\u3002\u6570\u5b66\u7684\u306b\u306f\u300c\u30d9\u30af\u30c8\u30eb\u3084\u884c\u5217\u3092\u3055\u3089\u306b\u62e1\u5f35\u3057\u305f\u3082\u306e\u300d\u3068\u8003\u3048\u308b\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002 \u6b21\u5143\u3054\u3068\u306e\u30a4\u30e1\u30fc\u30b8  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":0,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}