In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use the new () method in torch. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Microsoft Windows [version 10.0.18363.1256] (c) 2019 Microsoft Corporation. All rights reserved. C:\ Users\ chenxuqi > conda activate ssd4pytorch2_2_0 (ssd4pytorch2_2_0) C:\ Users\ chenxuqi > pythonPython 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]:: Anaconda, Inc. On win32Type "help", "copyright", "credits" or "license" for more information. > import torch > > torch.manual_seed (seed=20200910) > a = torch.zeros (3CM4) > > atensor. Atensor ([[0.2824,-0.3715, 0.9088,-1.7601], [- 0.1806, 2.0937, 1.0406,-1.7651], [1.1216, 0.8440, 0.1783,0.6859]) > > torch.manual_seed (seed=20200910) > > a = torch.randn (3prime4) > atensor -0.3715, 0.9088,-1.7601], [- 0.1806, 2.0937, 1.0406,-1.7651], [1.1216, 0.8440, 0.1783, 0.6859]) > a.new (4) tensor ([0.,0.,0.,0.]) > a.new () tensor ([]) > a.new (5jin6) tensor ([[1.8370e+25, 1.4603e-19, 0.0000e+00, 0.0000e+00]) 2.1019e-44, 0.0000e+00], [- 3.0652e-36, 4.5916e-41, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00], [0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00], [0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00, 5.2751e-11, 0.0000e+00], [2.8026e-45, 1.1625e+33] -5.1397e-05, 4.5916e-41, 0.0000e+00, 0.0000e+00]) > > KeyboardInterrupt > > KeyboardInterrupt > a.new (5) tensor ([[1.7743e+28, 1.3458e-14], [1.2689e+31, 3.2745e-12], [7.5555e+31, 1.2705e+31], [3.2611e-12, 7.5555e+31], [1.2705e+31, 1.7225e+22]) > > a.new (3) tensor ([0.,0.) 0.]) > that's all about how to use the new () method in torch. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.