{"id":2510,"date":"2022-04-19T06:59:25","date_gmt":"2022-04-19T06:59:25","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=2510"},"modified":"2022-04-19T06:59:25","modified_gmt":"2022-04-19T06:59:25","slug":"pytorch-packages","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/04\/19\/pytorch-packages\/","title":{"rendered":"PyTorch Packages"},"content":{"rendered":"\n<p>PyTorch is an optimized tensor library for deep learning using CPUs and GPUs. PyTorch has a rich set of packages which are used to perform deep learning concepts. These packages help us in optimization, conversion, and loss calculation, etc. Let&#8217;s get a brief knowledge of these packages.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><th>S.No<\/th><th>Name<\/th><th>Description<\/th><\/tr><tr><td>1.<\/td><td>Torch<\/td><td>The torch package includes data structure for multi-dimensional tensors and mathematical operation over these are defined.<\/td><\/tr><tr><td>2.<\/td><td>torch.Tensor<\/td><td>This package is a multi-dimensional matrix which contains an element of a single data type.<\/td><\/tr><tr><td>3.<\/td><td>Tensor Attributes<\/td><td><\/td><\/tr><tr><td>a) torch.dtype<\/td><td>It is an object which represents the datatype of thetorch.Tensor.<\/td><\/tr><tr><td>b) torch.device<\/td><td>It is an object that represents the device on which torch.Tensor will be allocated.<\/td><\/tr><tr><td>c) torch.layout<\/td><td>It is an object which represents a memory layout of a toch.Tensor.<\/td><\/tr><tr><td>4.<\/td><td>Type Info<\/td><td>The numerical properties of a torch.dtype will be accessed through either the torch.iinfo or the torch.finfo.<\/td><\/tr><tr><td>1) torch.finfo<\/td><td>It is an object which represents the numerical properties of a floating-point torch.dtype.<\/td><\/tr><tr><td>2) torch.iinfo<\/td><td>It is an object which represents the numerical properties of an integer torch.dtype.<\/td><\/tr><tr><td>5.<\/td><td>torch.sparse<\/td><td>Torch supports sparse tensors in COO (rdinate) format, which will efficiently store and process tensors for which the majority of elements are zero.<\/td><\/tr><tr><td>6.<\/td><td>torch.cuda<\/td><td>Torch supports for CUDA tensor types which implement the same function as CPU tensors, but for computation they utilize GPUs.<\/td><\/tr><tr><td>7.<\/td><td>torch.Storage<\/td><td>A torch.Storage is a contiguous, one-dimensional array of a single data type.<\/td><\/tr><tr><td>8.<\/td><td>torch.nn<\/td><td>This package provides us many more classes and modules to implement and train the neural network.<\/td><\/tr><tr><td>9.<\/td><td>torch.nn.functional<\/td><td>This package has functional classes which are similar to torch.nn.<\/td><\/tr><tr><td>10.<\/td><td>torch.optim<\/td><td>This package is used to implement various optimization algorithm.<\/td><\/tr><tr><td>11.<\/td><td>torch.autogard<\/td><td>This package provides classes and functions to implement automatic differentiation of arbitrary scalar value functions.<\/td><\/tr><tr><td>12.<\/td><td>torch.distributed<\/td><td>This package supports three backends and each one is with different capabilities.<\/td><\/tr><tr><td>13.<\/td><td>torch.distribution<\/td><td>This package allows us to construct the stochastic computation graphs, and stochastic gradient estimators for optimization<\/td><\/tr><tr><td>14.<\/td><td>torch.hub<\/td><td>It is a pre-trained model repository which is designed to facilitate research reproducibility.<\/td><\/tr><tr><td>15.<\/td><td>torch.multiprocessing<\/td><td>It is a wrapper around the native multiprocessing module.<\/td><\/tr><tr><td>16.<\/td><td>torch.utils.bottleneck<\/td><td>It is a tool which can be used as an initial step for debugging bottlenecks in our program.<\/td><\/tr><tr><td>17.<\/td><td>torch.utils.checkpoint<\/td><td>It is used to create checkpoint in our source program.<\/td><\/tr><tr><td>18.<\/td><td>torch.tils.cpp_extension<\/td><td>It is used to create the extension of C++, CUDA, and other languages.<\/td><\/tr><tr><td>19.<\/td><td>torch.utils.data<\/td><td>This package is mainly used for creating the dataset.<\/td><\/tr><tr><td>20.<\/td><td>torch.utils.dlpack<\/td><td>It will use to decode the Dlpack into tensor.<\/td><\/tr><tr><td>21.<\/td><td>torch.onnx<\/td><td>The&nbsp;<strong>ONNX<\/strong>&nbsp;exporter is a trace-based exporter, which means that it operates by executing your model once and exporting the operators which were actually run during this run<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>PyTorch is an optimized tensor library for deep learning using CPUs and GPUs. PyTorch has a rich set of packages which are used to perform deep learning concepts. These packages help us in optimization, conversion, and loss calculation, etc. Let&#8217;s get a brief knowledge of these packages. S.No Name Description 1. Torch The torch package [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[374],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2510"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=2510"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2510\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=2510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=2510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=2510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}