当前位置: 首页 > news >正文

[Python] Python中的多重继承

文章目录

  • Lora中的例子

Lora中的例子

  • https://github.com/michaelnny/QLoRA-LLM/blob/main/qlora_llm/models/lora.py#L211C1-L243C10
  • 如果继承两个父类,并且父类的__init__参数不一样,则可以显式的调用父类init;如果用super().__init__()则需要 父类每一个类中也都调用super().__init__().
class LoRALinear4bit(Linear4bit, LoRALayer):def __init__(self,in_features,out_features,bias=True,compress_statistics=True,quant_type='fp4',compute_dtype=None,device=None,r: int = 0,lora_scaling: float = 1.0,lora_dropout: float = 0.0,merge_weights: bool = True,) -> None:Linear4bit.__init__(self,input_features=in_features,output_features=out_features,bias=bias,compute_dtype=compute_dtype,compress_statistics=compress_statistics,quant_type=quant_type,device=device,)LoRALayer.__init__(self,r=r,lora_scaling=lora_scaling,lora_dropout=lora_dropout,merge_weights=merge_weights,)
http://www.lqws.cn/news/65611.html

相关文章:

  • 儿童节快乐,聊聊数字的规律和同余原理
  • STM32——CAN总线
  • 助力高校AI教学与科研:GpuGeek推出618算力支持活动
  • Launcher3体系化之路
  • python打卡day42
  • vscode 代理模式(agent mode),简单尝试一下。
  • 02.05、链表求和
  • debian12.9或ubuntu,vagrant离线安装插件vagrant-libvirt,20250601
  • Maven(黑马)
  • mybatis02
  • while循环判断数字位数
  • MobaXterm国内下载与安装使用教程
  • 【位运算】两整数之和(medium)
  • nt!MiDispatchFault函数分析之nt!MiCompleteProtoPteFault函数的作用
  • STM32F407寄存器操作(多通道单ADC+DMA)
  • Android第十一次面试补充篇
  • Python训练营打卡 Day42
  • leetcode0404. 左叶子之和-easy
  • 神经网络-Day42
  • Cesium快速入门到精通系列教程三:添加物体与3D建筑物
  • 【渲染】拆解《三国:谋定天下》场景渲染技术
  • POJO、DTO和VO:Java应用中的三种关键对象详解
  • 每日算法-250601
  • 【C++】多态
  • Socket网络编程之UDP套件字
  • Docker安装mitproxy
  • 大规模真实场景 WiFi 感知基准数据集
  • Beta分布Dirichlet分布
  • xPSR
  • DDD架构