{"id":4714,"date":"2021-03-10T10:00:45","date_gmt":"2021-03-10T01:00:45","guid":{"rendered":"https:\/\/www.kagoya.jp\/howto\/?p=4714"},"modified":"2022-08-19T10:35:29","modified_gmt":"2022-08-19T01:35:29","slug":"gpu-container5","status":"publish","type":"post","link":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/","title":{"rendered":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011"},"content":{"rendered":"<div class=\"easy-series-toc\">  <table class=\"easy-series-toc-table\">    <thead>      <tr>        <th>\u3010\u9023\u8f09\u4f01\u753b\u3011GPU\u30b3\u30f3\u30c6\u30ca\u6d3b\u7528 \u3010\u51686\u56de\u3011<\/th>      <\/tr>    <\/thead>    <tbody>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container1\/\">GPU\u30b3\u30f3\u30c6\u30ca\u3068\u306f\u4f55\u304b\uff1f\u4f55\u304c\u4fbf\u5229\u306a\u306e\u304b\uff1f\u3010\u7b2c1\u56de\uff1aGPU\u30b3\u30f3\u30c6\u30ca\u3067\u901f\u653b\u74b0\u5883\u69cb\u7bc9\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container2\/\">TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2460\u3010\u7b2c2\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790\u301c\u6e96\u5099\u7de8\u301c\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container3\/\">TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2461\u3010\u7b2c3\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790\u301c\u5b9f\u8df5\u7de8\u301c\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container4\/\">Chainer\u3092\u4f7f\u3063\u305f\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3010\u7b2c4\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u6a5f\u68b0\u5b66\u7fd2\u3059\u308b\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td>PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011        <\/td>      <\/tr>    <\/tbody>  <\/table><\/div><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png\" alt=\"PyTorch\u306e\u6d3b\u7528\" class=\"wp-image-7164\"\/><\/figure>\n<\/div>\n\n\n<p>AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fChainer\uff08\u30c1\u30a7\u30a4\u30ca\u30fc\uff09\u3067scikit-learn\u4ed8\u5c5e\u306e\u300eIris plants dataset\u300f\u3092\u4f7f\u3044\u3001\uff13\u7a2e\u985e\u306e\u3042\u3084\u3081\uff08\u30a2\u30a4\u30ea\u30b9\uff09\u306e\u82b1\u306e\u6e2c\u5b9a\u5024\u304b\u3089\u3001\u3069\u306e\u54c1\u7a2e\u306b\u5c5e\u3059\u308b\u304b\u3092\u5206\u985e\u3059\u308b\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3053\u306e\u9023\u8f09\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u672c\u9023\u8f09\u306f\u3001\u51686\u56de\u306e\u30b7\u30ea\u30fc\u30ba\u3092\u901a\u3057\u3066\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u3001GPU\u306e\u74b0\u5883\u69cb\u7bc9\u3092\u884c\u3046\u305f\u3081\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u6d3b\u7528\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u300c\u6a5f\u68b0\u5b66\u7fd2\u3084\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092GPU\u3067\u5b9f\u884c\u3057\u3066\u307f\u305f\u3044\u3051\u3069\u96e3\u3057\u305d\u3046\u2026\u300d\u306a\u3069\u5c0e\u5165\u306b\u30cf\u30fc\u30c9\u30eb\u3092\u611f\u3058\u3089\u308c\u3066\u3044\u308b\u65b9\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u74b0\u5883\u69cb\u7bc9\u306b\u8981\u3059\u308b\u5de5\u6570\u3092\u5727\u5012\u7684\u306b\u524a\u6e1b\u3057\u3001\u5373\u5ea7\u306b\u8ab2\u984c\u306b\u53d6\u308a\u7d44\u3080\u3053\u3068\u304c\u3067\u304d\u308b\u30e1\u30ea\u30c3\u30c8\u3092\u611f\u3058\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u306b\u5fc5\u8981\u306a\u77e5\u8b58\u3084\u64cd\u4f5c\u65b9\u6cd5\u3092\u3001\u5f53\u793e\u306eGPU\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u3044\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u9023\u8f09\u3092\u8aad\u307f\u7d42\u3048\u308b\u3053\u308d\u306b\u306f\u3001TensorFlow\u3084PyTorch\u306a\u3069\u306e\u30e1\u30b8\u30e3\u30fc\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u305f\u6f14\u7fd2\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_1-scaled.jpg\" alt=\"\" class=\"wp-image-7162\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">\u672c\u9023\u8f09\u306f\u3001\u3053\u3061\u3089\u306e\u624b\u9806\u3067\u9032\u3081\u3066\u3044\u307e\u3059<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbGPU\u30b3\u30f3\u30c6\u30ca\u3068\u306f\u4f55\u304b\uff1f\u4f55\u304c\u4fbf\u5229\u306a\u306e\u304b\uff1f\uff08\u7b2c1\u56de\uff09<\/h3>\n\n\n\n<p>AI\u521d\u5b66\u8005\u304cGPU\u3092\u4f7f\u3063\u3066\u6a5f\u68b0\u5b66\u7fd2\u3084\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306b\u53d6\u308a\u7d44\u307f\u305f\u3044\u5834\u5408\u3001\u74b0\u5883\u69cb\u7bc9\u306b\u60f3\u50cf\u4ee5\u4e0a\u306e\u5de5\u6570\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u4f5c\u696d\u306b\u8981\u3059\u308b\u6642\u9593\u3092\u6975\u529b\u524a\u6e1b\u3059\u308b\u305f\u3081\u306b\u30b3\u30f3\u30c6\u30ca\u6280\u8853\u3092\u9069\u7528\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u304b\u3089GPU\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u6e96\u5099\u3068\u624b\u9806\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u25cfGPU\u30b3\u30f3\u30c6\u30ca\u3068\u306f\u4f55\u304b\uff1f\u4f55\u304c\u4fbf\u5229\u306a\u306e\u304b\uff1f\uff08\u7b2c1\u56de\uff09<br><a href=\"\/howto\/cloud\/gpu-container1\/\">https:\/\/www.kagoya.jp\/howto\/cloud\/gpu-container1\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbTensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2460\uff08\u7b2c2\u56de\uff09<\/h3>\n\n\n\n<p>OSS\uff08\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\uff09\u306e\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e2d\u304b\u3089<mark>TensorFlow\uff08\u30c6\u30f3\u30bd\u30eb\u30d5\u30ed\u30fc\uff09\u3001Keras\uff08\u30b1\u30e9\u30b9\uff09<\/mark>\u3092\u53d6\u308a\u4e0a\u3052\u3001\u3053\u308c\u3089\u304c\u7a3c\u50cd\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u304b\u3089GPU\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002TensorFlow\u306fKeras\u3092\u53d6\u308a\u8fbc\u3080\u5f62\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u3059\u308b\u969b\u306e\u4f7f\u3044\u52dd\u624b\u306e\u826f\u3055\u304b\u3089\u3001\u591a\u304f\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u56de\u3067\u306f\u30b3\u30f3\u30c6\u30ca\u5185\u306eTensorFlow\u3067GPU\u3092\u5229\u7528\u3067\u304d\u308b\u72b6\u614b\u307e\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u25cfGPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790?\u6e96\u5099\u7de8?\uff08\u7b2c2\u56de\uff09<br><a href=\"\/howto\/cloud\/gpu-container2\/\">https:\/\/www.kagoya.jp\/howto\/cloud\/gpu-container2\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbTensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2461\uff08\u7b2c3\u56de\uff09<\/h3>\n\n\n\n<p><mark>TensorFlow\uff08\u30c6\u30f3\u30bd\u30eb\u30d5\u30ed\u30fc\uff09\u3084Theano\uff08\u30c6\u30a2\u30ce\uff09\uff0fCNTK\uff08Cognitive Toolkit\uff09<\/mark>\u306e\u8907\u6570\u306e\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3068\u3057\u3066\u5229\u7528\u53ef\u80fd\u306a<mark>Keras\uff08\u30b1\u30e9\u30b9\uff09<\/mark>\u3092\u53d6\u308a\u4e0a\u3052\u3001TensorFlow\u3068Keras\u3092\u4f7f\u3063\u305f\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3092\u884c\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306fAI\u521d\u5b66\u8005\u306e\u65b9\u304c\u89aa\u3057\u307f\u3084\u3059\u3044\u8ab2\u984c\u3092\u6271\u3046\u3053\u3068\u3092\u610f\u56f3\u3057\u3001TensorFlow\u306e\u516c\u5f0f\u30ac\u30a4\u30c9\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u300c\u521d\u5fc3\u8005\u306e\u305f\u3081\u306e TensorFlow 2.0 \u5165\u9580\u300d\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u25cfGPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790?\u5b9f\u8df5\u7de8?\uff08\u7b2c3\u56de\uff09<br><a href=\"\/howto\/cloud\/gpu-container3\/\">https:\/\/www.kagoya.jp\/howto\/cloud\/gpu-container3\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbChainer\u3092\u4f7f\u3063\u305f\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\uff08\u7b2c4\u56de\uff09<\/h3>\n\n\n\n<p>\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u6709\u540d\u306a<mark>Chainer\uff08\u30c1\u30a7\u30a4\u30ca\u30fc\uff09<\/mark>\u306e\u5229\u7528\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002\u30b3\u30f3\u30c6\u30ca\u304b\u3089Python\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u7d50\u679c\u3092\u901a\u3057\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002C\u8a00\u8a9e\u306b\u6bd4\u3079\u3066\u51e6\u7406\u6642\u9593\u304c\u304b\u304b\u308b\u3068\u8a00\u308f\u308c\u3066\u3044\u308bPython\u3067\u3059\u304c\u3001\u6570\u5024\u8a08\u7b97\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308b<mark>NumPy\uff08\u30ca\u30e0\u30d1\u30a4\uff09<\/mark>\u3082\u5229\u7528\u3057\u307e\u3059\u3002\u4eca\u56de\u6271\u3046\u984c\u6750\u3068\u3057\u3066Chainer\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u25cfGPU\u30b3\u30f3\u30c6\u30ca\u3067\u6a5f\u68b0\u5b66\u7fd2\u3059\u308b\uff08\u7b2c4\u56de\uff09<br><a href=\"\/howto\/cloud\/gpu-container4\/\">https:\/\/www.kagoya.jp\/howto\/cloud\/gpu-container4\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbPyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\uff08\u7b2c5\u56de\uff09\u4eca\u56de\u306e\u8a18\u4e8b<\/h3>\n\n\n\n<p>Python\u306e\u6a5f\u68b0\u5b66\u7fd2\u7528\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3042\u308b<mark>PyTorch\uff08\u30d1\u30a4\u30c8\u30fc\u30c1\uff09<\/mark>\u3092\u53d6\u308a\u4e0a\u3052\u307e\u3059\u3002PyTorch\u3067\u306f<mark>Tensor\uff08\u30c6\u30f3\u30bd\u30eb\uff09<\/mark>\u3068\u3044\u3046\u578b\u3067\u884c\u5217\u3092\u8868\u73fe\u3057\u307e\u3059\u3002Tensor\u306f\u591a\u6b21\u5143\u914d\u5217\u3092\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3042\u308a\u3001GPU\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001PyTorch\u304c\u7a3c\u50cd\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u5229\u7528\u3057\u3001PyTorch\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u6cbf\u3063\u3066GPU\u3092\u4f7f\u3063\u305f\u8a08\u7b97\u51e6\u7406\u306e\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30fbOpenPose\u306b\u3088\u308b\u95a2\u7bc0\u70b9\u62bd\u51fa\u30fb\u59ff\u52e2\u63a8\u5b9a\uff08\u7b2c6\u56de\uff09<\/h3>\n\n\n\n<p>\u30ab\u30e1\u30e9\u753b\u50cf\u306eAI\u753b\u50cf\u8a8d\u8b58\u3068\u8a00\u3048\u3070\u300c\u9854\u8a8d\u8a3c\u300d\u3092\u601d\u3044\u6d6e\u304b\u3079\u308b\u4eba\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u6700\u8fd1\u306f\u4e00\u6b69\u9032\u307f\u3001\u4eba\u304c\u6620\u3063\u305f\u9759\u6b62\u753b\u3084\u52d5\u753b\u304b\u3089\u95a2\u7bc0\u70b9\u62bd\u51fa\u30fb\u59ff\u52e2\u63a8\u5b9a\u306b\u53d6\u308a\u7d44\u3080\u30b1\u30fc\u30b9\u304c\u5897\u3048\u3066\u3044\u307e\u3059\u3002\u4eba\u4f53\u3001\u9854\u3001\u624b\u8db3\u306a\u3069\u306e\u30ad\u30fc\u30dd\u30a4\u30f3\u30c8\u3092\u753b\u50cf\u304b\u3089\u691c\u51fa\u3059\u308b\u6280\u8853\u304c\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306b\u3088\u308a\u3001\u5b9f\u7528\u30ec\u30d9\u30eb\u307e\u3067\u5411\u4e0a\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002\u3053\u306e\u56de\u3067\u306f<mark>OpenPose\uff08\u30aa\u30fc\u30d7\u30f3\u30dd\u30fc\u30ba\uff09<\/mark>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092GPU\u4e0a\u3067\u52d5\u304b\u3059\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3044\u3001\u52d5\u753b\u30d5\u30a1\u30a4\u30eb\u306e\u95a2\u7bc0\u70b9\u62bd\u51fa\u624b\u9806\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PyTorch\u304c\u52d5\u304f\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3063\u305f\u6a5f\u68b0\u5b66\u7fd2<\/h2>\n\n\n\n<p>\u4eca\u56de\u306fPyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u884c\u3046\u6a5f\u68b0\u5b66\u7fd2\u306e\u5c0e\u5165\u90e8\u5206\u3092\u8aac\u660e\u3057\u307e\u3059\u3002\u7279\u306bTensor(\u30c6\u30f3\u30bd\u30eb)\u306e\u6271\u3044\u65b9\u306b\u91cd\u70b9\u3092\u7f6e\u3044\u305f\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u306b\u5148\u305a\u306f\u30b3\u30f3\u30c6\u30ca\u306e\u6e96\u5099\u3068GPU\u306e\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3044\u3001\u305d\u306e\u3042\u3068\u306bPytorch\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u6cbf\u3063\u3066\u57fa\u672c\u7684\u306a\u8003\u3048\u65b9\u3092\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PyTorch(\u30d1\u30a4\u30c8\u30fc\u30c1)\u3068\u306f<\/h3>\n\n\n\n<p>\u4eca\u56de\u3001\u3068\u308a\u3042\u3052\u308b Pytorch\u306fPython\u5411\u3051\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u6a5f\u68b0\u5b66\u7fd2\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u904e\u53bb\u306e\u9023\u8f09\u8a18\u4e8b\u3067\u3068\u308a\u3042\u3052\u305fTensorFlow\u3001Keras\u3001Chainer\u306a\u3069\u4ed6\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u540c\u69d8\u306b\u30dd\u30d4\u30e5\u30e9\u30fc\u306a\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002Python\u306e\u6570\u5024\u8a08\u7b97\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306e\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3042\u308b<mark>NumPy\uff08\u30ca\u30e0\u30d1\u30a4\uff09<\/mark>\u3068\u4f7f\u3044\u65b9\u304c\u4f3c\u3066\u3044\u308b\u3053\u3068\u3082\u4eba\u6c17\u306e\u3072\u3068\u3064\u306e\u8981\u56e0\u3068\u8a00\u3048\u305d\u3046\u3067\u3059\u3002\u305d\u3057\u3066\u4f55\u3068\u8a00\u3063\u3066\u3082\u3001GPU\u3092\u5229\u7528\u3057\u3066\u9ad8\u901f\u306b\u6f14\u7b97\u51e6\u7406\u304c\u3067\u304d\u308b\u70b9\u304cGPU\u30e6\u30fc\u30b6\u30fc\u306b\u3068\u3063\u3066\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4eca\u56de\u884c\u3046\u3053\u3068\u306e\u6982\u8981<\/h3>\n\n\n\n<p>AI\u521d\u5b66\u8005\u306e\u65b9\u304c\u89aa\u3057\u307f\u3084\u3059\u3044\u8ab2\u984c\u3092\u6271\u3046\u3053\u3068\u3092\u610f\u56f3\u3057\u3001\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb1.7.1 (\u82f1\u8a9e\u7248) <a href=\"https:\/\/pytorch.org\/tutorials\/\" target=\"_blank\" rel=\"noopener\">WELCOME TO PYTORCH TUTORIALS<\/a>\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b <strong>Deep Learning with PyTorch: A 60 Minute Blitz<\/strong> \u3092\u53d6\u308a\u4e0a\u3052\u307e\u3057\u305f\u3002<br>\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u3092\u88dc\u8db3\u3057\u306a\u304c\u3089\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u3001\u4e0b\u8a18\u306e\u8a18\u8f09\u4e8b\u9805\u3082\u3042\u308f\u305b\u3066\u898b\u3066\u3044\u305f\u3060\u3051\u308b\u3068\u7406\u89e3\u304c\u6df1\u307e\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u3010\u53c2\u8003\u30b5\u30a4\u30c8\uff1a<a style=\"word-break: break-all;\" href=\"https:\/\/pytorch.org\/tutorials\/beginner\/deep_learning_60min_blitz.html\" target=\"_blank\" rel=\"noopener\">https:\/\/pytorch.org\/tutorials\/beginner\/deep_learning_60min_blitz.html<\/a>\u3011<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u6e96\u5099\u3059\u308b<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_2.png\" alt=\"PyTorch\u306e\u30b3\u30f3\u30c6\u30ca\" class=\"wp-image-7163\"\/><\/figure>\n<\/div>\n\n\n<p>\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u53d6\u308a\u639b\u304b\u308b\u524d\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u6e96\u5099\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<br>docker hub\u304b\u3089PyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092pull\u3057\u307e\u3059\u3002<br>Dockerhub \u53c2\u7167\u30b5\u30a4\u30c8\uff1a<a href=\"https:\/\/hub.docker.com\/r\/pytorch\/pytorch\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/hub.docker.com\/r\/pytorch\/pytorch\/<\/a><br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ docker pull pytorch\/pytorch\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nUsing default tag: latest\nlatest: Pulling from pytorch\/pytorch\n171857c49d0f: Pull complete\n419640447d26: Pull complete\n\u3000(\u7565)\nDigest: sha256:9cffbe6c391a0dbfa2a305be24b9707f87595e832b444c2bde52f0ea183192f1\nStatus: Downloaded newer image for pytorch\/pytorch:latest\ndocker.io\/pytorch\/pytorch:latest\n<\/pre><\/div>\n\n\n<p>\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ docker images pytorch\/pytorch\nREPOSITORY          TAG                 IMAGE ID            CREATED             SIZE\npytorch\/pytorch     latest              349148663741        4 weeks ago         5.61GB\n<\/pre><\/div>\n\n\n<p>pyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u5185\u304b\u3089nvidia-smi\u3092\u5b9f\u884c\u3057\u3001GPU\u5468\u8fba\u60c5\u5831\u306b\u3064\u3044\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ docker run --gpus all pytorch\/pytorch nvidia-smi\nTue Feb 16 06:47:17 2021\n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage\/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|                               |                      |               MIG M. |\n|===============================+======================+======================|\n|   0  Tesla P40           Off  | 00000000:03:00.0 Off |                    0 |\n| N\/A   29C    P8    10W \/ 250W |      2MiB \/ 22919MiB |      0%      Default |\n|                               |                      |                  N\/A |\n+-------------------------------+----------------------+----------------------+\n\n+-----------------------------------------------------------------------------+\n| Processes:                                                                  |\n|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n|        ID   ID                                                   Usage      |\n|=============================================================================|\n|  No running processes found                                                 |\n+-----------------------------------------------------------------------------+\n<\/pre><\/div>\n\n\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u30c9\u30e9\u30a4\u30d0\u30fc\u3084CUDA\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831\u306a\u3069\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<p>GPU\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u4e00\u5ea6\u629c\u3051\u305f\u306e\u3067\u3001\u3042\u3089\u305f\u3081\u3066PyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u304b\u3089bash\u3092\u305f\u3061\u3042\u3052\u3001pip3 list\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ docker run --gpus all -it pytorch\/pytorch:latest bash\nroot@d72e335c3962:\/workspace# pip3 list\nPackage                Version\n---------------------- -------------------\nbackcall               0.2.0\nbeautifulsoup4         4.9.3\nbrotlipy               0.7.0\ncertifi                2020.12.5\ncffi                   1.14.4\nchardet                3.0.4\n(\u7565)\nsoupsieve              2.1\ntorch                  1.7.1\ntorchelastic           0.2.0\ntorchtext              0.8.0a0+0f911ec\ntorchvision            0.8.2\ntqdm                   4.51.0\ntraitlets              5.0.5\ntyping-extensions      3.7.4.3\nurllib3                1.25.11\nwcwidth                0.2.5\nwheel                  0.35.1\nroot@d72e335c3962:\/workspace#\n<\/pre><\/div>\n\n\n<p>\u300c<mark>torch<\/mark>\u300d\u300c<mark>torchvision<\/mark>\u300d\u306a\u3069Pytorch\u3067\u3088\u304f\u4f7f\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6b21\u306bGPU\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nroot@d72e335c3962:\/workspace# python3\nPython 3.7.9 (default, Aug 31 2020, 12:42:55)\n&#x5B;GCC 7.3.0] :: Anaconda, Inc. on linux\nType &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.\n&gt;&gt;&gt; import torch\n&gt;&gt;&gt; a = torch.cuda.is_available()\n&gt;&gt;&gt; print(a)\nTrue\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u3088\u3046\u306b True \u3068\u8868\u793a\u3055\u308c\u308c\u3070PyTorch\u306e\u30b3\u30f3\u30c6\u30ca\u304b\u3089GPU\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3067\u3059\u304c\u3001False \u3068\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u306fNVIDIA\u30c9\u30e9\u30a4\u30d0\u30fc\u304c\u53e4\u3044\u3001CUDA\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u9069\u5207\u3067\u306a\u3044\u7b49\u306e\u7406\u7531\u3067GPU\u304c\u5229\u7528\u3067\u304d\u306a\u3044\u72b6\u614b\u306a\u306e\u3067\u3001\u30c9\u30e9\u30a4\u30d0\u30fc\u306e\u66f4\u65b0\u3084CUDA\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u306e\u5bfe\u5fdc\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>GPU\u304c\u5229\u7528\u53ef\u80fd\u306a\u72b6\u614b\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u306e\u3067\u3001\u5b9f\u969b\u306bGPU\u3092\u4f7f\u3063\u305f\u6f14\u7b97\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; ten1 = torch.tensor(&#x5B;0, 1]).cuda()\n&gt;&gt;&gt; ten2 = torch.tensor(&#x5B;2, 3]).cuda()\n&gt;&gt;&gt; ten1 + ten2\ntensor(&#x5B;2, 4], device=&#039;cuda:0&#039;)\n<\/pre><\/div>\n\n\n<p>GPU\u3092\u4f7f\u3063\u305f\u30d9\u30af\u30c8\u30eb\u306e\u8a08\u7b97\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<br>\u3067\u306f\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u306b\u6cbf\u3063\u3066\u6f14\u7fd2\u3092\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PyTorch\u306e\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u5b9f\u8df5\u3059\u308b<\/h2>\n\n\n\n<p>\u524d\u8ff0\u3057\u305f\u3088\u3046\u306b\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u5185\u5bb9\u306b\u6cbf\u3063\u3066\u3001GPU\u30b3\u30f3\u30c6\u30ca\u5185\u304b\u3089PyTorch\u3092\u4f7f\u3044\u307e\u3059\u3002<strong>\u82f1\u8a9e\u7248\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<\/strong>\u306f\u3001\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b2021\u5e742\u6708\u6642\u70b9\u3067<strong>1.7.1<\/strong>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u3061\u3089\u3082\u3042\u308f\u305b\u3066\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u53c2\u8003\u30b5\u30a4\u30c8\uff1a<a href=\"https:\/\/pytorch.org\/tutorials\/\" target=\"_blank\" rel=\"noopener\">WELCOME TO PYTORCH TUTORIALS<\/a><\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u6f14\u7fd2\u3067\u306f\u3001\u4e0a\u8a18\u306e\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u4e2d\u306e\u4ee5\u4e0b\u306e\u30d1\u30fc\u30c8\u3092\u3068\u308a\u3042\u3052\u307e\u3057\u305f\u3002<br>\u53c2\u8003\u30b5\u30a4\u30c8\uff1a<a href=\"https:\/\/pytorch.org\/tutorials\/beginner\/deep_learning_60min_blitz.html\" target=\"_blank\" rel=\"noopener\">DEEP LEARNING WITH PYTORCH: A 60 MINUTE BLITZ<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PyTorch\u3063\u3066\u4f55\uff1f<\/h3>\n\n\n\n<p>PyTorch\u306fPython\u30d9\u30fc\u30b9\u306e\u79d1\u5b66\u8a08\u7b97\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3001\u6b21\u306e2\u3064\u306e\u5927\u304d\u306a\u5f79\u5272\u308a\u3092\u62c5\u3044\u307e\u3059<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Numpy\u306e\u4ee3\u66ff\u54c1\u3068\u3057\u3066GPU\u3084\u305d\u306e\u4ed6\u30a2\u30af\u30bb\u30e9\u30ec\u30fc\u30bf\u306e\u6f14\u7b97\u30d1\u30ef\u30fc\u3092\u5f15\u304d\u51fa\u3059<\/li><li>\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u5b9f\u88c5\u306b\u5f79\u7acb\u3064\u81ea\u52d5\u5fae\u5206\u30e9\u30a4\u30d6\u30e9\u30ea<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u30b4\u30fc\u30eb<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>PyTorch\u306eTensor\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u7406\u89e3\u3059\u308b\u3053\u3068<\/li><li>\u753b\u50cf\u3092\u5206\u985e\u3059\u308b\u305f\u3081\u306e\u5c0f\u3055\u306a\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3067\u304d\u308b\u3053\u3068\uff08\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u53d6\u308a\u6271\u3044\u307e\u305b\u3093\uff09<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">TENSORS(\u30c6\u30f3\u30bd\u30eb)<\/h3>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u306f\u3001\u914d\u5217\u3084\u884c\u5217\u306b\u975e\u5e38\u306b\u3088\u304f\u4f3c\u305f\u7279\u6b8a\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u3057\u3066\u3044\u307e\u3059\u3002PyTorch\u3067\u306f\u30c6\u30f3\u30bd\u30eb\u3092\u901a\u3057\u3066\u30e2\u30c7\u30eb\u306e\u5165\u529b\u3068\u51fa\u529b\u306a\u3089\u3073\u306b\u30e2\u30c7\u30eb\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u306fNumPy\u306endarray\u306b\u4f3c\u305f\u591a\u6b21\u5143\u914d\u5217\u3067\u3059\u304c\u3001GPU\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3088\u308a\u9ad8\u901f\u306b\u6f14\u7b97\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002ndarray\u306b\u7cbe\u901a\u3057\u3066\u3044\u308b\u5834\u5408\u306fTensorAPI\u3092\u3059\u3050\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u53c2\u7167\u3057\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u64cd\u4f5c\u306b\u3064\u3044\u3066\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; import torch\n&gt;&gt;&gt; import numpy as np\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f numpy \u3082\u4f7f\u7528\u3057\u307e\u3059\u306e\u3067\u3001PyTorch\u3068\u3044\u3063\u3057\u3087\u3046\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002PyTorch\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b numpy \u3092\u547c\u3073\u51fa\u3059\u306e\u540c\u3058\u3088\u3046\u306a\u611f\u899a\u3067 torch \u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3053\u3068\u3067\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30c6\u30f3\u30bd\u30eb\u306e\u521d\u671f\u5316<\/h4>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u306f\u4ee5\u4e0b\u306b\u793a\u3059\u3088\u3046\u306b\u3001\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u3067\u306f\u5b9f\u969b\u306b\u307f\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br><b>\u30c7\u30fc\u30bf\u304b\u3089\u76f4\u63a5 Tensor \u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5<\/b><br>\u30c6\u30f3\u30bd\u30eb\u306f\u30c7\u30fc\u30bf\u304b\u3089\u76f4\u63a5\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u969b\u306b\u6570\u5024\u306e\u578b\u3092\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3001\u30c7\u30fc\u30bf\u578b\u306f\u81ea\u52d5\u7684\u306b\u6c7a\u307e\u308a\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; data = &#x5B;&#x5B;1, 2],&#x5B;3, 4]]\n&gt;&gt;&gt; x_data = torch.tensor(data)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(data)\n&#x5B;&#x5B;1, 2], &#x5B;3, 4]]\n&gt;&gt;&gt; print(x_data)\ntensor(&#x5B;&#x5B;1, 2],\n        &#x5B;3, 4]])\n<\/pre><\/div>\n\n\n<p>\u4e0a\u306e\u4f8b\u3067\u306f <mark>torch.tensor<\/mark> \u95a2\u6570\u3092\u4f7f\u3044\u3001\u76f4\u63a5\u6570\u5024\u3092\u6307\u5b9a\u3057\u3066\u30c6\u30f3\u30bd\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3010\u88dc\u8db3\u3011<br>\u30c7\u30fc\u30bf\u578b\u3092\u6307\u5b9a\u3059\u308b\u3068\u304d\u306f\u3001dtype\u3092\u5f15\u6570\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; data = torch.tensor(&#x5B;&#x5B;1, 2], &#x5B;3, 4.]], dtype=torch.float64)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(data)\ntensor(&#x5B;&#x5B;1., 2.],\n        &#x5B;3., 4.]], dtype=torch.float64)\n<\/pre><\/div>\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u4f5c\u6210\u6642\u306b\u3001\u5f15\u6570\u3068\u3057\u306664\u30d3\u30c3\u30c8\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3092\u793a\u3059 float64 \u3068\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br>\u51fa\u529b\u7d50\u679c\u3092\u307f\u308b\u3068\u3001\u5404\u3005\u306e\u5024\u306b\u5c0f\u6570\u70b9\u304c\u3064\u3044\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>NumPy\u914d\u5217\u304b\u3089<\/b><br>\u30c6\u30f3\u30bd\u30eb\u306fNumPy\u914d\u5217\u304b\u3089\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff08\u9006\u3082\u540c\u69d8\u3067\u3059\u3002<a href=\"https:\/\/pytorch.org\/tutorials\/beginner\/blitz\/tensor_tutorial.html#bridge-with-numpy\" target=\"_blank\" rel=\"noopener\">Bridge with NumPy<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\uff09\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; np_array = np.array(data)\n&gt;&gt;&gt; x_np = torch.from_numpy(np_array)\n<\/pre><\/div>\n\n\n<p>NumPy \u914d\u5217\u304b\u3089\u5909\u63db\u3059\u308b\u5834\u5408\u306f\u4e0a\u306e\u4f8b\u306e\u3088\u3046\u306b <mark>torch.from_numpy<\/mark> \u95a2\u6570\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u3068\u304d\u306e\u30c7\u30fc\u30bf\u578b\u306f NumPy \u306e\u578b\u3092\u7d99\u627f\u3057\u307e\u3059\u3002<br><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; print(x_np)\ntensor(&#x5B;&#x5B;1., 2.],\n        &#x5B;3., 4.]], dtype=torch.float64)\n<\/pre><\/div>\n\n\n<p><b>\u5225\u306e\u30c6\u30f3\u30bd\u30eb\u304b\u3089\uff1a<\/b><br>\u65b0\u3057\u3044\u30c6\u30f3\u30bd\u30eb\u306f\u3001\u660e\u793a\u7684\u306b\u4e0a\u66f8\u304d\u3055\u308c\u306a\u3044\u9650\u308a\u3001\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u30c6\u30f3\u30bd\u30eb\u306e\u5c5e\u6027\u3092\u7d99\u627f\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; x_ones = torch.ones_like(x_data) # x_data\u306e\u5c5e\u6027\u3092\u4fdd\u6301\nprint(f&quot;Ones Tensor: \\n {x_ones} \\n&quot;)\n\nx_rand = torch.rand_like(x_data, dtype=torch.float) # x_data\u306e\u30c7\u30fc\u30bf\u578b\u3092\u4e0a\u66f8\u304d\nprint(f&quot;Random Tensor: \\n {x_rand} \\n&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nOnes Tensor:\n tensor(&#x5B;&#x5B;1, 1],\n        &#x5B;1, 1]])\n\nRandom Tensor:\n tensor(&#x5B;&#x5B;0.4687, 0.4422],\n        &#x5B;0.6415, 0.8786]])\n<\/pre><\/div>\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u4f5c\u6210\u6642\u306b\u660e\u793a\u7684\u306b\u30c7\u30fc\u30bf\u578b\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u30b1\u30fc\u30b9\u3067\u306f\u3001\u524d\u51fa\u306e x_data \u306e\u5c5e\u6027\u3092\u7d99\u627f\u3057\u3001x_ones \u306e\u30c7\u30fc\u30bf\u578b\u306f\u6574\u6570\u3067\u3057\u305f\u304c\u3001<br>\u660e\u793a\u7684\u306b\u30c7\u30fc\u30bf\u578b\u3092 torch.float \u3068\u6307\u5b9a\u3057\u305f\u30b1\u30fc\u30b9\u3067\u306f\u3001x_rand \u306e\u30c7\u30fc\u30bf\u578b\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>\u4e71\u6570\u3084\u5b9a\u6570\u3092\u4f7f\u3046\u5834\u5408<\/b><br>shape \u3068\u3044\u3046\u540d\u524d\u306e\u30bf\u30d7\u30eb\u3092\u5f15\u6570\u306b\u3057\u305f\u4e0b\u8a18\u306e\u95a2\u6570\u306e\u51fa\u529b\u7d50\u679c\u3092\u6bd4\u8f03\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; shape = (2,3,)\nrand_tensor = torch.rand(shape)\nones_tensor = torch.ones(shape)\nzeros_tensor = torch.zeros(shape)\n\nprint(f&quot;Random Tensor: \\n {rand_tensor} \\n&quot;)\nprint(f&quot;Ones Tensor: \\n {ones_tensor} \\n&quot;)\nprint(f&quot;Zeros Tensor: \\n {zeros_tensor}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRandom Tensor:\n tensor(&#x5B;&#x5B;0.5838, 0.7678, 0.6982],\n        &#x5B;0.9962, 0.2261, 0.6554]])\n\nOnes Tensor:\n tensor(&#x5B;&#x5B;1., 1., 1.],\n        &#x5B;1., 1., 1.]])\n\nZeros Tensor:\n tensor(&#x5B;&#x5B;0., 0., 0.],\n        &#x5B;0., 0., 0.]])\n<\/pre><\/div>\n\n\n<p>1\u756a\u76ee\u306e\u51fa\u529b\u7d50\u679c\u306f\u3001<mark>torch.rand<\/mark> \u95a2\u6570\u3092\u4f7f\u3044\u3001\u4e71\u6570\u3067\uff12\u00d7\uff13\u306e\u30c6\u30f3\u30bd\u30eb\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br>2\u756a\u76ee\u306e\u51fa\u529b\u7d50\u679c\u306f\u3001<mark>torch.ones<\/mark> \u95a2\u6570\u3092\u4f7f\u3044\u30011\u3067\u30c6\u30f3\u30bd\u30eb\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br>3\u756a\u76ee\u306e\u51fa\u529b\u7d50\u679c\u306f\u3001<mark>torch.zeros<\/mark> \u95a2\u6570\u3092\u4f7f\u3044\u30010\u3067\u30c6\u30f3\u30bd\u30eb\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30c6\u30f3\u30bd\u30eb\u5c5e\u6027<\/h4>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u5c5e\u6027\u306f\u3001\u305d\u308c\u3089\u306e\u30b7\u30a7\u30a4\u30d7\u3001\u30c7\u30fc\u30bf\u578b\u306a\u3089\u3073\u306b\u30c6\u30f3\u30bd\u30eb\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30c7\u30d0\u30a4\u30b9\u306b\u3064\u3044\u3066\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; tensor = torch.rand(3,4)\n\nprint(f&quot;Shape of tensor: {tensor.shape}&quot;)\nprint(f&quot;Datatype of tensor: {tensor.dtype}&quot;)\nprint(f&quot;Device tensor is stored on: {tensor.device}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nShape of tensor: torch.Size(&#x5B;3, 4])\nDatatype of tensor: torch.float32\nDevice tensor is stored on: cpu\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">\u30c6\u30f3\u30bd\u30eb\u6f14\u7b97<\/h4>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001\u8ee2\u7f6e\u3001\u30a4\u30f3\u30c7\u30af\u30b7\u30f3\u30b0\u3001\u30b9\u30e9\u30a4\u30b7\u30f3\u30b0\u3001\u30e9\u30f3\u30c0\u30e0\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u306a\u3069100\u3092\u8d85\u3048\u308b\u30c6\u30f3\u30bd\u30eb\u6f14\u7b97\u306e\u4e2d\u304b\u3089\u3044\u304f\u3064\u304b\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/pytorch.org\/docs\/stable\/torch.html\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u60c5\u5831<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c6\u30f3\u30bd\u30eb\u6f14\u7b97\u306fGPU\u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3059\uff08\u901a\u5e38CPU\u3088\u308a\u3082\u9ad8\u901f\u3067\u3059\uff09\u3002Google Colab\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306fGPU\u3092\u5272\u308a\u5f53\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# We move our tensor to the GPU if available\nif torch.cuda.is_available():\n  tensor = tensor.to(&#039;cuda&#039;)\n<\/pre><\/div>\n\n\n<p>\u4ee5\u4e0b\u306e\u6f14\u7b97\u51e6\u7406\u3092\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002NumPy API\u306b\u7cbe\u901a\u3057\u3066\u3044\u308b\u304b\u305f\u3067\u3042\u308c\u3070 Tensor API\u3082\u7c21\u5358\u306b\u4f7f\u7528\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<br><b>Numpy\u30e9\u30a4\u30af\u306a\u30a4\u30f3\u30c7\u30af\u30b7\u30f3\u30b0\u3068\u30b9\u30e9\u30a4\u30b7\u30f3\u30b0\uff1a<\/b><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor = torch.ones(4, 4)\ntensor&#x5B;:,1] = 0\nprint(tensor)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor(&#x5B;&#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.]])\n<\/pre><\/div>\n\n\n<p><mark>torch.ones<\/mark> \u95a2\u6570\u3092\u4f7f\u3044\u3001\u5b9a\u65701\u3067\u57cb\u3081\u308b4\u00d74\u306e\u30c6\u30f3\u30bd\u30eb\u3092\u4f5c\u6210\u3057\u3001\u5404\u884c\u306e2\u756a\u76ee\u306e\u5024\u306b0\u3092\u4ee3\u5165\u3059\u308b\u64cd\u4f5c\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>\u30c6\u30f3\u30bd\u30eb\u306e\u7d50\u5408<\/b>\u3000 <mark>torch.cat<\/mark> \u95a2\u6570\u3092\u4f7f\u3063\u3066\u30c6\u30f3\u30bd\u30eb\u3092\u4ed6\u306e\u30c6\u30f3\u30bd\u30eb\u3068\u7d50\u5408\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<mark>torch.stack<\/mark> \u95a2\u6570\u3082\u3042\u308f\u305b\u3066\u53c2\u7167\u3059\u308b\u3053\u3068\u3067\u53cc\u65b9\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u7406\u89e3\u3057\u307e\u3057\u3087\u3046\u3002\uff08torch.stack\u3067\u4f7f\u3046\u30c6\u30f3\u30bd\u30eb\u306f\u3059\u3079\u3066\u540c\u30b5\u30a4\u30ba\u3067\u3042\u308b\u3053\u3068 \u306a\u3069\uff09<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt1 = torch.cat(&#x5B;tensor, tensor, tensor], dim=1)\nprint(t1)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor(&#x5B;&#x5B;1., 0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1., 1., 0., 1., 1., 1., 0., 1., 1.]])\n<\/pre><\/div>\n\n\n<p>\u524d\u51fa\u306e tensor \u3092torch.cat\u306e\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u3053\u3068\u3067\u3001\u305d\u308c\u3089\u3092\u7d50\u5408\u3057\u305f\u30c6\u30f3\u30bd\u30eb t1 \u3092\u8fd4\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u7d50\u5408\u3059\u308b\u8ef8\u306f dim=1 \u306b\u3088\u3063\u3066\u6307\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><b>\u30c6\u30f3\u30bd\u30eb\u306e\u4e57\u7b97<\/b><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# This computes the element-wise product\nprint(f&quot;tensor.mul(tensor) \\n {tensor.mul(tensor)} \\n&quot;)\n# Alternative syntax:\nprint(f&quot;tensor * tensor \\n {tensor * tensor}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor.mul(tensor)\n tensor(&#x5B;&#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.]])\n\ntensor * tensor\n tensor(&#x5B;&#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.]])\n<\/pre><\/div>\n\n\n<p>2\u3064\u306e\u30c6\u30f3\u30bd\u30eb\u9593\u306e\u884c\u5217\u4e57\u7b97\u3092\u5b9f\u884c\u3057\u307e\u3059<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nprint(f&quot;tensor.matmul(tensor.T) \\n {tensor.matmul(tensor.T)} \\n&quot;)\n# Alternative syntax:\nprint(f&quot;tensor @ tensor.T \\n {tensor @ tensor.T}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor.matmul(tensor.T)\n tensor(&#x5B;&#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.]])\n\ntensor @ tensor.T\n tensor(&#x5B;&#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.],\n        &#x5B;3., 3., 3., 3.]])\n<\/pre><\/div>\n\n\n<p><b>\u30a4\u30f3\u30d7\u30ec\u30fc\u30b9\u64cd\u4f5c<\/b>\u3000_ \u63a5\u5c3e\u8f9e(\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2\u30b5\u30d5\u30a3\u30c3\u30af\u30b9)\u304c\u4ed8\u3044\u305f\u64cd\u4f5c\u306f\u30a4\u30f3\u30d7\u30ec\u30fc\u30b9(in-place\uff1a\u305d\u306e\u5834\u3067\u3059\u3050\u306b\u5b9f\u884c\u3059\u308b)\u6f14\u7b97\u306b\u306a\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070 x.copy_(y), x.t_()\u306e\u3088\u3046\u306a\u8a18\u8ff0\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nprint(tensor, &quot;\\n&quot;)\ntensor.add_(5)\nprint(tensor)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor(&#x5B;&#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.],\n        &#x5B;1., 0., 1., 1.]])\n\ntensor(&#x5B;&#x5B;6., 5., 6., 6.],\n        &#x5B;6., 5., 6., 6.],\n        &#x5B;6., 5., 6., 6.],\n        &#x5B;6., 5., 6., 6.]])\n<\/pre><\/div>\n\n\n<p>\u6ce8\u610f<br>\u30a4\u30f3\u30d7\u30ec\u30fc\u30b9(in-place)\u6f14\u7b97\u306f\u30e1\u30e2\u30ea\u3092\u3044\u304f\u3089\u304b\u7bc0\u7d04\u3057\u307e\u3059\u304c\u3001\u5c65\u6b74\u304c\u3059\u3050\u306b\u5931\u308f\u308c\u308b\u305f\u3081\u8a08\u7b97\u6642\u306b\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u30e1\u30e2\u30ea\u6d88\u8cbb\u3092\u6975\u529b\u56de\u907f\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3092\u9664\u304d\u3001\u30a4\u30f3\u30d7\u30ec\u30fc\u30b9(in-place)\u6f14\u7b97\u306e\u4f7f\u7528\u306f\u304a\u52e7\u3081\u3057\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">NumPy\u3068\u306e\u30d6\u30ea\u30c3\u30b8<\/h4>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u304cCPU\u4e0a\u306b\u3042\u308b\u5834\u5408\u3001Torch Tensor\u3068NumPy \u914d\u5217\u306f\u30e1\u30e2\u30ea\u4e0a\u306e\u540c\u3058\u9818\u57df\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001\u4e00\u65b9\u3092\u5909\u66f4\u3059\u308b\u3068\u4ed6\u65b9\u3082\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>Tensor \u304b\u3089 NumPy \u914d\u5217 \u3078<\/b><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt = torch.ones(5)\nprint(f&quot;t: {t}&quot;)\nn = t.numpy()\nprint(f&quot;n: {n}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt: tensor(&#x5B;1., 1., 1., 1., 1.])\nn: &#x5B;1. 1. 1. 1. 1.]\n<\/pre><\/div>\n\n\n<p><mark>torch.ones<\/mark> \u95a2\u6570\u3092\u4f7f\u30441\u3067\u57cb\u3081\u305f1\u00d75 \u30c6\u30f3\u30bd\u30eb\u3092\u4f5c\u6210\u3057\u3001t\u306b\u4ee3\u5165\u3057\u305f\u3082\u306e\u3092NumPy \u914d\u5217\u306b\u5f15\u304d\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c6\u30f3\u30bd\u30eb\u306e\u5909\u5316\u306fNumPy\u914d\u5217\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt.add_(1)\nprint(f&quot;t: {t}&quot;)\nprint(f&quot;n: {n}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt: tensor(&#x5B;2., 2., 2., 2., 2.])\nn: &#x5B;2. 2. 2. 2. 2.]\n<\/pre><\/div>\n\n\n<p><mark>add_()<\/mark> \u95a2\u6570\u3067\u3001t\u306b1\u3092\u52a0\u7b97\u3057\u307e\u3057\u305f\u3002<br>\u305d\u306e\u7d50\u679c\u3001Torch Tensor\u3068NumPy \u914d\u5217\u306f\u30e1\u30e2\u30ea\u30a2\u30c9\u30ec\u30b9\u3092\u5171\u6709\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30c6\u30f3\u30bd\u30eb\u306e\u5909\u66f4\u306b\u3088\u3063\u3066NumPy\u914d\u5217\u3082\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<br>\u9006\u306b\u3064\u3044\u3066\u3082\u3001\u540c\u69d8\u306e\u7d50\u679c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>NumPy \u914d\u5217\u304b\u3089Tensor \u3078<\/b><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nn = np.ones(5)\nt = torch.from_numpy(n)\n<\/pre><\/div>\n\n\n<p><mark>np.ones()<\/mark> \u95a2\u6570\u306b\u3088\u308a\u30011\u3067\u57cb\u3081\u3089\u308c\u305f\u914d\u5217n\u304b\u3089<mark>torch.from_numpy<\/mark> \u95a2\u6570\u3067 NumPy\u914d\u5217 \u304b\u3089\u30c6\u30f3\u30bd\u30eb\u306b\u5024\u304c\u5f15\u304d\u6e21\u3055\u308c\u307e\u3057\u305f\u3002<br>NumPy\u914d\u5217\u306e\u5909\u66f4\u306f\u3001\u30c6\u30f3\u30bd\u30eb\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnp.add(n, 1, out=n)\nprint(f&quot;t: {t}&quot;)\nprint(f&quot;n: {n}&quot;)\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nt: tensor(&#x5B;2., 2., 2., 2., 2.], dtype=torch.float64)\nn: &#x5B;2. 2. 2. 2. 2.]\n<\/pre><\/div>\n\n\n<p><mark>np.add()<\/mark> \u95a2\u6570\u3067\u3001n\u306b1\u3092\u52a0\u7b97\u3057\u3001\u623b\u308a\u5024\u306e\u5024\u3092n\u306b\u4e0a\u66f8\u304d\u3057\u307e\u3057\u305f\u3002<br>\u305d\u306e\u7d50\u679c\u3001NumPy\u914d\u5217\u306e\u5909\u66f4\u306b\u3088\u3063\u3066\u30c6\u30f3\u30bd\u30eb\u3082\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u88dc\u8db3\uff1aGPU\u3067\u306e\u6f14\u7b97\u51e6\u7406<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">CUDA Tensors(CUDA \u30c6\u30f3\u30bd\u30eb)<\/h4>\n\n\n\n<p>PyTorch Tensor\u3067\u306f <mark>.to<\/mark> \u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u4efb\u610f\u306e\u30c7\u30d0\u30a4\u30b9\u306b\u30c6\u30f3\u30bd\u30eb\u3092\u79fb\u52d5\u3067\u304d\u307e\u3059\u3002CUDA\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067GPU\u3067\u6f14\u7b97\u51e6\u7406\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br>CUDA\u304c\u5229\u7528\u53ef\u80fd\u306a\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&gt;&gt;&gt; if torch.cuda.is_available():\n...     device = torch.device(&quot;cuda&quot;)           # CUDA\u3092device\u3068\u3057\u3066\u5b9a\u7fa9\n...     y = torch.ones_like(x, device=device)   # GPU\u4e0a\u306b\u76f4\u63a5\u30c6\u30f3\u30bd\u30eb\u3092\u4f5c\u6210\n...     x = x.to(device)                        # .to() \u3067\u3001x\u3092GPU\u306b\u8ee2\u9001\u3002.to(&quot;cuda&quot;)\u306e\u8a18\u8ff0\u3082\u53ef\n...     z = x + y\n...     print(z)\n...     print(z.to(&quot;cpu&quot;, torch.double))        # .to \u3067\u3001CPU\u306b\u8ee2\u9001\u3057\u3001\u3044\u3063\u3057\u3087\u306b\u30c7\u30fc\u30bf\u578b\u3082\u5909\u66f4\n...\n<\/pre><\/div>\n\n\n<p><em>out:<\/em><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntensor(&#x5B;2.6759], device=&#039;cuda:0&#039;)\ntensor(&#x5B;2.6759], dtype=torch.float64)\n<\/pre><\/div>\n\n\n<p>\u51fa\u529b\u7d50\u679c <b>device=&#8217;cuda:0&#8242;<\/b> \u304b\u3089GPU\u3067CUDA\u30c6\u30f3\u30bd\u30eb\u6f14\u7b97\u304c\u3067\u304d\u305f\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<br>CPU\u8ee2\u9001\u6642\u306bdtype=torch.double\u3068\u3057\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001\u51fa\u529b\u7d50\u679c\u3068\u3057\u3066\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3042\u308b dtype=torch.float64 \u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><b>\u4eca\u56de\u306fPyTorch\u306e\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u6cbf\u3063\u3066\u3001\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u7684\u306a\u5229\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u307f\u3066\u304d\u307e\u3057\u305f\u3002<\/b><br>Numpy\u3068\u540c\u3058\u3088\u3046\u306a\u64cd\u4f5c\u304c\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u304c\u5b9f\u611f\u3067\u304d\u305f\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u307e\u305f\u3001PyTorch\u304c\u7a3c\u50cd\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u304b\u3089GPU\u3092\u4f7f\u3063\u305f\u8a08\u7b97\u51e6\u7406\u306e\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b21\u56de\u4e88\u544a \u7b2c6\u56de\uff1aOpenPose\u306b\u3088\u308b\u95a2\u7bc0\u70b9\u62bd\u51fa\u30fb\u59ff\u52e2\u63a8\u5b9a<\/h2>\n\n\n\n<p><mark>OpenPose\uff08\u30aa\u30fc\u30d7\u30f3\u30dd\u30fc\u30ba\uff09<\/mark>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3044\u3001\u4eba\u304c\u6620\u3063\u305f\u9759\u6b62\u753b\u3084\u52d5\u753b\u304b\u3089\u95a2\u7bc0\u70b9\u62bd\u51fa\u30fb\u59ff\u52e2\u63a8\u5b9a\u306e\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.kagoya.jp\/gpu\/?argument=vqHX23Xs&amp;dmai=a5ebb99e1b6fa3\"><img decoding=\"async\" src=\"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpubana.png\" alt=\"GPU\u30b5\u30fc\u30d0\u30fc\" class=\"wp-image-3886\"\/><\/a><\/figure>\n<\/div><div class=\"easy-series-toc\">  <table class=\"easy-series-toc-table\">    <thead>      <tr>        <th>\u3010\u9023\u8f09\u4f01\u753b\u3011GPU\u30b3\u30f3\u30c6\u30ca\u6d3b\u7528 \u3010\u51686\u56de\u3011<\/th>      <\/tr>    <\/thead>    <tbody>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container1\/\">GPU\u30b3\u30f3\u30c6\u30ca\u3068\u306f\u4f55\u304b\uff1f\u4f55\u304c\u4fbf\u5229\u306a\u306e\u304b\uff1f\u3010\u7b2c1\u56de\uff1aGPU\u30b3\u30f3\u30c6\u30ca\u3067\u901f\u653b\u74b0\u5883\u69cb\u7bc9\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container2\/\">TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2460\u3010\u7b2c2\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790\u301c\u6e96\u5099\u7de8\u301c\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container3\/\">TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2461\u3010\u7b2c3\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790\u301c\u5b9f\u8df5\u7de8\u301c\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td><a href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container4\/\">Chainer\u3092\u4f7f\u3063\u305f\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u3010\u7b2c4\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u6a5f\u68b0\u5b66\u7fd2\u3059\u308b\u3011<\/a>        <\/td>      <\/tr>      <tr>        <td>PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011        <\/td>      <\/tr>    <\/tbody>  <\/table><\/div>","protected":false},"excerpt":{"rendered":"\u3010\u9023\u8f09\u4f01\u753b\u3011GPU\u30b3\u30f3\u30c6\u30ca\u6d3b\u7528 \u3010\u51686\u56de\u3011 GPU\u30b3\u30f3\u30c6\u30ca\u3068\u306f\u4f55\u304b\uff1f\u4f55\u304c\u4fbf\u5229\u306a\u306e\u304b\uff1f\u3010\u7b2c1\u56de\uff1aGPU\u30b3\u30f3\u30c6\u30ca\u3067\u901f\u653b\u74b0\u5883\u69cb\u7bc9\u3011 TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2460\u3010\u7b2c2\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf\u89e3\u6790\u301c\u6e96\u5099\u7de8\u301c\u3011 TensorFlow\u3068Keras\u306b\u3088\u308b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u2461\u3010\u7b2c3\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u753b\u50cf [&hellip;]","protected":false},"author":10,"featured_media":4717,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[145],"tags":[34,56,67,100],"pickup":[],"sitedisplay":[],"sitetarget":[],"class_list":["post-4714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hpc","tag-gpu","tag-56","tag-67","tag-hpc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4<\/title>\n<meta name=\"description\" content=\"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4\" \/>\n<meta property=\"og:description\" content=\"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/\" \/>\n<meta property=\"og:site_name\" content=\"\u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-10T01:00:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-19T01:35:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u9db4\u5ca1 \u8b19\u543e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9db4\u5ca1 \u8b19\u543e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/\"},\"author\":{\"name\":\"\u9db4\u5ca1 \u8b19\u543e\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/#\\\/schema\\\/person\\\/df4e644df3b6b3d2d54b27fb8623fb9d\"},\"headline\":\"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011\",\"datePublished\":\"2021-03-10T01:00:45+00:00\",\"dateModified\":\"2022-08-19T01:35:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/\"},\"wordCount\":337,\"image\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/wp-content\\\/uploads\\\/gpu202103a_catch.png\",\"keywords\":[\"GPU\",\"\u30b3\u30f3\u30c6\u30ca\",\"\u5b66\u8853\",\"HPC\"],\"articleSection\":[\"AI\u30fbIoT\u30fbHPC\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/\",\"url\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/\",\"name\":\"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/wp-content\\\/uploads\\\/gpu202103a_catch.png\",\"datePublished\":\"2021-03-10T01:00:45+00:00\",\"dateModified\":\"2022-08-19T01:35:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/#\\\/schema\\\/person\\\/df4e644df3b6b3d2d54b27fb8623fb9d\"},\"description\":\"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/wp-content\\\/uploads\\\/gpu202103a_catch.png\",\"contentUrl\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/wp-content\\\/uploads\\\/gpu202103a_catch.png\",\"width\":1200,\"height\":630,\"caption\":\"PyTorch\u306e\u6d3b\u7528\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/engineer\\\/hpc\\\/gpu-container5\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/#website\",\"url\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/\",\"name\":\"\u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4\",\"description\":\"\u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u904b\u55b6\u4f1a\u793e\u304c\u304a\u5c4a\u3051\u3059\u308b\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u30e1\u30c7\u30a3\u30a2\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/#\\\/schema\\\/person\\\/df4e644df3b6b3d2d54b27fb8623fb9d\",\"name\":\"\u9db4\u5ca1 \u8b19\u543e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g\",\"caption\":\"\u9db4\u5ca1 \u8b19\u543e\"},\"url\":\"https:\\\/\\\/www.kagoya.jp\\\/howto\\\/author\\\/tsuruoka\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4","description":"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/","og_locale":"ja_JP","og_type":"article","og_title":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4","og_description":"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh","og_url":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/","og_site_name":"\u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4","article_published_time":"2021-03-10T01:00:45+00:00","article_modified_time":"2022-08-19T01:35:29+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png","type":"image\/png"}],"author":"\u9db4\u5ca1 \u8b19\u543e","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u9db4\u5ca1 \u8b19\u543e","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"6\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#article","isPartOf":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/"},"author":{"name":"\u9db4\u5ca1 \u8b19\u543e","@id":"https:\/\/www.kagoya.jp\/howto\/#\/schema\/person\/df4e644df3b6b3d2d54b27fb8623fb9d"},"headline":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011","datePublished":"2021-03-10T01:00:45+00:00","dateModified":"2022-08-19T01:35:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/"},"wordCount":337,"image":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png","keywords":["GPU","\u30b3\u30f3\u30c6\u30ca","\u5b66\u8853","HPC"],"articleSection":["AI\u30fbIoT\u30fbHPC"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/","url":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/","name":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011 - \u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4","isPartOf":{"@id":"https:\/\/www.kagoya.jp\/howto\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#primaryimage"},"image":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png","datePublished":"2021-03-10T01:00:45+00:00","dateModified":"2022-08-19T01:35:29+00:00","author":{"@id":"https:\/\/www.kagoya.jp\/howto\/#\/schema\/person\/df4e644df3b6b3d2d54b27fb8623fb9d"},"description":"AI\u521d\u5b66\u8005\u306b\u3068\u3063\u3066\u30cf\u30fc\u30c9\u30eb\u306e\u3072\u3068\u3064\u306b\u306a\u3063\u3066\u3044\u308bGPU\u74b0\u5883\u69cb\u7bc9\u3092\u3067\u304d\u308b\u3060\u3051\u52b9\u7387\u7684\u306b\u884c\u3046\u305f\u3081\u306b\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u6709\u52b9\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u306b\u9023\u8f09\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u305f\u3002\u524d\u56de\u306fCh","breadcrumb":{"@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#primaryimage","url":"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png","contentUrl":"https:\/\/www.kagoya.jp\/howto\/wp-content\/uploads\/gpu202103a_catch.png","width":1200,"height":630,"caption":"PyTorch\u306e\u6d3b\u7528"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kagoya.jp\/howto\/engineer\/hpc\/gpu-container5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.kagoya.jp\/howto\/"},{"@type":"ListItem","position":2,"name":"PyTorch\u3067\u6a5f\u68b0\u5b66\u7fd2\u3010\u7b2c5\u56de:GPU\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30f3\u30bd\u30eb\u306e\u57fa\u672c\u3092\u7406\u89e3\u3059\u308b\u3011"}]},{"@type":"WebSite","@id":"https:\/\/www.kagoya.jp\/howto\/#website","url":"https:\/\/www.kagoya.jp\/howto\/","name":"\u30ab\u30b4\u30e4\u306e\u30b5\u30fc\u30d0\u30fc\u7814\u7a76\u5ba4","description":"\u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u904b\u55b6\u4f1a\u793e\u304c\u304a\u5c4a\u3051\u3059\u308b\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u30e1\u30c7\u30a3\u30a2","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kagoya.jp\/howto\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.kagoya.jp\/howto\/#\/schema\/person\/df4e644df3b6b3d2d54b27fb8623fb9d","name":"\u9db4\u5ca1 \u8b19\u543e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3aa257cb88c81f1f1b20b69ff2c2449d9943b4413ede75b7abcb3d7e1cc78850?s=96&d=mm&r=g","caption":"\u9db4\u5ca1 \u8b19\u543e"},"url":"https:\/\/www.kagoya.jp\/howto\/author\/tsuruoka\/"}]}},"views":18681,"_links":{"self":[{"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/posts\/4714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/comments?post=4714"}],"version-history":[{"count":0,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/posts\/4714\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/media\/4717"}],"wp:attachment":[{"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/media?parent=4714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/categories?post=4714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/tags?post=4714"},{"taxonomy":"pickup","embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/pickup?post=4714"},{"taxonomy":"sitedisplay","embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/sitedisplay?post=4714"},{"taxonomy":"sitetarget","embeddable":true,"href":"https:\/\/www.kagoya.jp\/howto\/wp-json\/wp\/v2\/sitetarget?post=4714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}