码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • nn.Linear & Tensor.masked_fill


    文章目录

    • 1. nn.Linear
    • 2. Tensor.masked_fill

    1. nn.Linear

    • torch.nn.Linear(in_features, out_features, bias=True, device=None, dtype=None)

      • Applies a linear transformation to the incoming data: y = x A T + b y = xA^T + b y=xAT+b
      • This module supports TensorFloat32.
      • On certain ROCm devices, when using float16 inputs this module will use different precision for backward.
    • Parameters

      • in_features – size of each input sample
      • out_features – size of each output sample
      • bias – If set to False, the layer will not learn an additive bias. Default: True
    • Shape:

      • Input: ( ∗ , H i n ) (*, H_{in}) (∗,Hin​), where * means any number of dimensions including none and H i n = in_features H_{in} = \text{in\_features} Hin​=in_features
      • Output: ( ∗ , H o u t ) (*, H_{out}) (∗,Hout​), where all but the last dimension are the same shape as the input and H o u t = out_features H_{out} = \text{out\_features} Hout​=out_features

    2. Tensor.masked_fill

    Tensor.masked_fill_(mask, value)

    Fills elements of self tensor with value where mask is True. The shape of mask must be broadcastable with the shape of the underlying tensor.

    • Parameters
      • mask (BoolTensor) – the boolean mask
      • value (float) – the value to fill in with
  • 相关阅读:
    基于51单片机DS18B20温度及电流检测-proteus仿真-源程序
    点云从入门到精通技术详解100篇-三维文物点云去噪与精简方法研究与应用(中)
    驱动开发:内核中实现Dump进程转储
    独立站建站实操:斗篷使用、AB收款【FP商家不能错过】
    【JUC】原子操作类及LongAddr源码分析
    植物大战僵尸杂交版v2.1最新整合版,附PC端+安卓端+iOS端安装包+修改器+安装教程!
    渲染基础概念 unity shader 材质相关学习
    两大Mac内存清理方法,嫌麻烦的就直接使用第二种
    直播课堂系统11--腾讯云点播管理模块(三)
    个人强化学习论文导航
  • 原文地址:https://blog.csdn.net/weixin_47532216/article/details/126138220
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号