`

randn(*size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False) -> Tensor

Returns a tensor filled with random numbers from a normal distribution
with mean `0` and variance `1` (also called the standard normal
distribution). .. math::
\text{out}_{i} \sim \mathcal{N}(0, 1) The shape of the tensor is defined by the variable argument :attr:`size`. Args:
size (int...): a sequence of integers defining the shape of the output tensor.
Can be a variable number of arguments or a collection like a list or tuple. Keyword args:
generator (:class:`torch.Generator`, optional): a pseudorandom number generator for sampling
out (Tensor, optional): the output tensor.
dtype (:class:`torch.dtype`, optional): the desired data type of returned tensor.
Default: if ``None``, uses a global default (see :func:`torch.set_default_tensor_type`).
layout (:class:`torch.layout`, optional): the desired layout of returned Tensor.
Default: ``torch.strided``.
device (:class:`torch.device`, optional): the desired device of returned tensor.
Default: if ``None``, uses the current device for the default tensor type
(see :func:`torch.set_default_tensor_type`). :attr:`device` will be the CPU
for CPU tensor types and the current CUDA device for CUDA tensor types.
requires_grad (bool, optional): If autograd should record operations on the
returned tensor. Default: ``False``.
pin_memory (bool, optional): If set, returned tensor would be allocated in
the pinned memory. Works only for CPU tensors. Default: ``False``. Example:: >>> torch.randn(4)
tensor([-2.1436, 0.9966, 2.3426, -0.6366])
>>> torch.randn(2, 3)
tensor([[ 1.5954, 2.8929, -1.0923],
[ 1.1719, -0.4709, -0.1996]])

`

torch.randn(*tensor_shape, **kwargs)的更多相关文章

  1. torch.rand、torch.randn、torch.normal、torch.linespace

    torch.rand(*size, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False) # ...

  2. PyTorch官方中文文档:torch.nn

    torch.nn Parameters class torch.nn.Parameter() 艾伯特(http://www.aibbt.com/)国内第一家人工智能门户,微信公众号:aibbtcom ...

  3. PyTorch官方中文文档:torch.Tensor

    torch.Tensor torch.Tensor是一种包含单一数据类型元素的多维矩阵. Torch定义了七种CPU tensor类型和八种GPU tensor类型: Data tyoe CPU te ...

  4. 实践torch.fx第二篇-fx量化实操

    好久不见各位,哈哈,又鸽了好久. 本文紧接上一篇<实践torch.fx第一篇--基于Pytorch的模型优化量化神器>继续说,主要讲如何利用FX进行模型量化. 为什么这篇文章拖了这么久,有 ...

  5. PyTorch官方中文文档:torch

    torch 包 torch 包含了多维张量的数据结构以及基于其上的多种数学操作.另外,它也提供了多种工具,其中一些可以更有效地对张量和任意类型进行序列化. 它有CUDA 的对应实现,可以在NVIDIA ...

  6. Pytorch中torch.autograd ---backward函数的使用方法详细解析,具体例子分析

    backward函数 官方定义: torch.autograd.backward(tensors, grad_tensors=None, retain_graph=None, create_graph ...

  7. pytorch中文文档-torch.nn常用函数-待添加-明天继续

    https://pytorch.org/docs/stable/nn.html 1)卷积层 class torch.nn.Conv2d(in_channels, out_channels, kerne ...

  8. torch.nn.functional中softmax的作用及其参数说明

    参考:https://pytorch-cn.readthedocs.io/zh/latest/package_references/functional/#_1 class torch.nn.Soft ...

  9. [转] Torch中实现mini-batch RNN

    工作中需要把一个SGD的LSTM改造成mini-batch的LSTM, 两篇比较有用的博文,转载mark https://zhuanlan.zhihu.com/p/34418001 http://ww ...

  10. (原)torch中的序列化

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6591667.html 参考网址: https://github.com/torch/torch7/bl ...

随机推荐

  1. Gnirehtet —— 通过 USB 让手机共享 PC 网络

    Gnirehtet 使用教程 什么是 Gnirehtet? Gnirehtet("Tethering" 反写)是 Google 开发的开源工具,用于 通过 USB 共享 PC 网络 ...

  2. Java编程--单例(Singleton)设计模式

    单例设计模式 一个类只有一个实例,根据创建的时机又分为懒汉式和饿汉式,它们的区别主要体现在实例的创建时机和线程安全性上. 饿汉式(Eager Initialization): 特点: 在类加载时就创建 ...

  3. 校园圈子系统:Uni-app跨端渲染+TP6实时推送核心逻辑与代码

    在TP6中实现实时推送功能,核心逻辑围绕WebSocket服务搭建.用户连接管理.消息路由和性能优化展开.以下是详细的实现步骤和逻辑说明: TP6实时推送核心逻辑 WebSocket服务搭建 使用Wo ...

  4. 基于ThinkPHP5知识付费系统AntPayCMS

    历时6个月开发基于ThinkPHP5.1知识付费系统AntPayCMS,自己作IT开发已经10年,一直想自己开发自己的系统,虽然看网上也有很多知识付费类的网站的,但基于TP基本很少,而且自己也一直想做 ...

  5. 信息资源管理文字题之“IT服务管理的核心流程和具体内容”

    一.为了充分利用ERP信息系统资源,LX集团采用了各种先进的信息系统管理概念和方法,包括IT服务管理. 要求:说明IT服务管理流程包括那两大核心类别,分别说明他们个包含哪些具体流程 二.答案 答:两大 ...

  6. 【语义分割专栏】先导篇:评价指标(PA,CPA,IoU,mIoU,FWIoU,F1)

    目录 前言 混淆矩阵 计算混淆矩阵 评价指标 像素准确率(Pixel Accuracy,PA) 类别像素准确率(Class Pixel Accuracy,CPA) 类别平均像素准确率(Mean Pix ...

  7. rancher 卸载后重装报错

    报错信息 kubectl create namespace cattle-system Error from server (InternalError): Internal error occurr ...

  8. C++ ADL 与 模板

    什么是ADL ADL(Argument Dependent Lookup),参数依赖查找,明确的意思是依赖参数的函数查找,即对于函数调用,不仅会依照常规的名称查找规则,还会在函数参数所在的命名空间内查 ...

  9. L2-4、选择微调还是提示工程?企业级内容生成的最佳实践

    一.Prompt 工程与模型微调的本质区别 Prompt 工程的特点 Prompt 工程是通过精心设计输入提示来引导大语言模型生成所需输出的技术.它不改变模型的基本参数,而是利用现有模型能力. 工作原 ...

  10. Innosetup 安装 VC_redist 运行时库

    #普通安装vc_redis.x86.exe(会提示用户做出选择),在innosetup的[Run]属性中添加下面这一行 Filename: "{app}VC_redist.x86.exe&q ...