【办公类-53-04】20250209Python模仿制作2024学年第二学期校历

背景需求:

马上开学了,又要制作校历(删划节假日)。之前我都是用网络的图片,然后在PPT里修改。

存在问题:

网络校历是从周日开始的,但日常我们老师做教案,都是默认从周一到周五(周六周日)

所以这学期,我想用Python模仿网上图片,生成EXCEL的校历图片,同时将“周日”放到最后一列显示,确保“周一”在第一列。

1.0版本——与网络版一样(周日开始)

代码展示


'''
模仿制作2025年2月下学期的校历(只有日期)
星火讯飞、阿夏
20250209
'''
from openpyxl import Workbook
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
import datetime
import time
from openpyxl.utils import get_column_letter

path = r'C:\Users\jg2yXRZ\OneDrive\桌面\20250217校历'
title = '2024学年第二学期校历'
# 起始日期前空几天
m=0

# 创建一个新的Excel工作簿
workbook = Workbook()
sheet = workbook.active

# 设置标题行
# title_row = ["周次",  "星期一", "星期二", "星期三", "星期四", "星期五", "星期六","星期日",]
title_row = ["周次",  "一", "二", "三", "四", "五", "六","日",]
sheet.append(title_row)

# 设置日期范围
start_date = datetime.date(2025, 2, 17)
end_date = datetime.date(2025, 6, 30)

# 生成日期列表并包含标题行和空格行
date_list = [title_row]
for i in range(m):
    date_list.append([])  # 添加一个空格行

current_day = start_date

while current_day <= end_date:
    date_list.append([current_day])
    current_day += datetime.timedelta(days=1)

# 计算周数和将日期列表写入Excel
current_week = 1
for i in range(1, len(date_list), 7):
    # 获取当前周的日期列表
    week_dates = date_list[i:i+7]
    
    # 在A列中添加周次
    sheet.cell(row=current_week + 1, column=1).value = f"{current_week}"
    cell = sheet.cell(row=current_week + 1, column=1)
    cell.alignment = Alignment(horizontal='center', vertical='center')
    
    # 设置A列单元格边框样式为黑色实线
    thin_border = Border(left=Side(style='thin', color='000000'), 
                         right=Side(style='thin', color='000000'), 
                         top=Side(style='thin', color='000000'), 
                         bottom=Side(style='thin', color='000000'))
    cell.border = thin_border
    cell.font = Font(size=18)
    
    # 在正确的单元格中添加日期
    for j in range(len(week_dates)):
        cell = sheet.cell(row=current_week + 1, column=j + 2)
        
        # 检查日期是否为当月的第一天,如果是则显示“月/1”,否则显示“月/日”
        if week_dates[j]:  # Check if the list is not empty
            if week_dates[j][0].year == 2025 and week_dates[j][0].month == 2 and week_dates[j][0].day == 17:
                cell.value = f"{week_dates[j][0].year}/{week_dates[j][0].month}/{week_dates[j][0].day}"
            elif week_dates[j][0].day == 1:
                cell.value = f"{week_dates[j][0].month}/{week_dates[j][0].day}"
            else:
                cell.value = f"{week_dates[j][0].day}"
        
        cell.alignment = Alignment(horizontal='center', vertical='center')
        
        # 根据月份设置单元格底纹颜色
        month = week_dates[j][0].month
        if month == 2:
            cell.fill = PatternFill(start_color="FFFFCC", end_color="FFFFCC", fill_type="solid")  # 浅黄色
        elif month == 3:
            cell.fill = PatternFill(start_color="FFCCCC", end_color="FFCCCC", fill_type="solid")  # 浅红色
        elif month == 4:
            cell.fill = PatternFill(start_color="CCFFCC", end_color="CCFFCC", fill_type="solid")  # 浅绿色
        elif month == 5:
            cell.fill = PatternFill(start_color="CCCCCC", end_color="CCCCCC", fill_type="solid")  # 浅灰色
        elif month == 6:
            cell.fill = PatternFill(start_color="FFCC99", end_color="FFCC99", fill_type="solid")  # 浅橘色
        
        # 设置单元格边框样式为黑色实线
        thin_border = Border(left=Side(style='thin', color='000000'), 
                             right=Side(style='thin', color='000000'), 
                             top=Side(style='thin', color='000000'), 
                             bottom=Side(style='thin', color='000000'))
        cell.border = thin_border
        # 设置字体大小为18磅
        if week_dates[j][0].year == 2025 and week_dates[j][0].month == 2 and week_dates[j][0].day == 17:
            cell.font = Font(size=13)
            cell.alignment = Alignment(horizontal='center', vertical='center')
        else:
            cell.font = Font(size=18)
            cell.alignment = Alignment(horizontal='center', vertical='center')
    
    # 更新周数并移动到下一周
    current_week += 1

# 确保标题行的所有单元格也居中且有框线,并将第一行标题单元格底色设置为浅蓝色
for col in range(1, len(title_row) + 1):
    cell = sheet.cell(row=1, column=col)
    cell.alignment = Alignment(horizontal='center', vertical='center')
    thin_border = Border(left=Side(style='thin', color='000000'), 
                         right=Side(style='thin', color='000000'), 
                         top=Side(style='thin', color='000000'), 
                         bottom=Side(style='thin', color='000000'))
    cell.border = thin_border
    if col >= 1 and col <= 8:  # Apply blue fill to A1-H1
        cell.fill = PatternFill(start_color="ADD8E6", end_color="ADD8E6", fill_type="solid")  # 浅蓝色
        cell.font = Font(size=18)



# A列第二行开始,单元格的填充底色与B列单元格颜色相同
for row in range(2, sheet.max_row + 1):
    for col in range(1, 2):  # Apply fill from B column to A-H columns
        b_cell = sheet.cell(row=row, column=col + 1)
        a_cell = sheet.cell(row=row, column=col)
        a_cell.fill = b_cell.fill.copy()  # Use copy() to avoid unhashable type error

# 设置所有行的行高和列宽
for row in range(1, sheet.max_row + 1):
    sheet.row_dimensions[row].height = 30

for col in range(1, sheet.max_column + 1):
    column_letter = get_column_letter(col)
    sheet.column_dimensions[column_letter].width = 10  # Set width to a reasonable value for better readability

#  在第一行上方插入一个空行,然后合并A1-H1,写入“第二学期”20磅,居中
sheet.insert_rows(1)
sheet.merge_cells('A1:H1')
sheet.cell(row=1, column=1).value = "上海市中小学2024学年度第二学期校历(阿夏20250209)"
sheet.cell(row=1, column=1).alignment = Alignment(horizontal='center', vertical='center')
sheet.cell(row=1, column=1).font = Font(size=18)
sheet.cell(row=1, column=1).border = thin_border
sheet.cell(row=1, column=1).fill = PatternFill(start_color="ADD8E6", end_color="ADD8E6", fill_type="solid")  # 浅蓝色


# 保存工作簿
workbook.save(path + fr"\{title}.xlsx")
time.sleep(2)

下一步就是查找不上班的日期

可以看到第10周五天,第10周周日5月27日与第11周的三天上班合并,第19周与第20周(只有1天)合并为6天,一共可以做19周的计划

2.0版本——实际需要的央视(周一开始,双休日、假日空白)

代码展示


'''
模仿制作2025年2月下学期的校历(标注节假日)
星火讯飞、阿夏
202502010
'''
from openpyxl import Workbook
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
import datetime
import time
from openpyxl.utils import get_column_letter
from openpyxl.worksheet.page import PageMargins

path = r'C:\Users\jg2yXRZ\OneDrive\桌面\20250217校历'
title = '2024学年第二学期校历(阿夏20250209)'
# 起始日期前空几天
m=0

# 创建一个新的Excel工作簿
workbook = Workbook()
sheet = workbook.active

# 设置页边距(单位为英寸)

# 设置页边距(单位为厘米)
left_margin_cm = 1.3
right_margin_cm = 1.3
top_margin_cm = 2
bottom_margin_cm = 2

# 将厘米转换为英寸
left_margin_inch = left_margin_cm * 0.393701
right_margin_inch = right_margin_cm * 0.393701
top_margin_inch = top_margin_cm * 0.393701
bottom_margin_inch = bottom_margin_cm * 0.393701

# 设置页边距(单位为英寸)
margins = PageMargins(left=left_margin_inch, right=right_margin_inch, top=top_margin_inch, bottom=bottom_margin_inch)

# margins = PageMargins(left=3.322, right=3.322, top=5.08, bottom=5.08)
sheet.page_margins = margins

# 设置标题行
# title_row = ["周次",  "星期一", "星期二", "星期三", "星期四", "星期五", "星期六","星期日",]
title_row = ["周次",  "一", "二", "三", "四", "五", "六","日",]
sheet.append(title_row)

# 设置日期范围
start_date = datetime.date(2025, 2, 17)
end_date = datetime.date(2025, 6, 30)

# 生成日期列表并包含标题行和空格行
date_list = [title_row]
for i in range(m):
    date_list.append([])  # 添加一个空格行

current_day = start_date

while current_day <= end_date:
    date_list.append([current_day])
    current_day += datetime.timedelta(days=1)

# 计算周数和将日期列表写入Excel
current_week = 1
for i in range(1, len(date_list), 7):
    # 获取当前周的日期列表
    week_dates = date_list[i:i+7]
    
    # 在A列中添加周次
    sheet.cell(row=current_week + 1, column=1).value = f"第{current_week}周"
    cell = sheet.cell(row=current_week + 1, column=1)
    cell.alignment = Alignment(horizontal='center', vertical='center')
    
    # 设置A列单元格边框样式为黑色实线
    thin_border = Border(left=Side(style='thin', color='000000'), 
                         right=Side(style='thin', color='000000'), 
                         top=Side(style='thin', color='000000'), 
                         bottom=Side(style='thin', color='000000'))
    cell.border = thin_border
    cell.font = Font(size=16)
    
    # 在正确的单元格中添加日期
    for j in range(len(week_dates)):
        cell = sheet.cell(row=current_week + 1, column=j + 2)
        
        # 检查日期是否为当月的第一天,如果是则显示“月/1”,否则显示“月/日”
        if week_dates[j]:  # Check if the list is not empty
            if week_dates[j][0].year == 2025 and week_dates[j][0].month == 2 and week_dates[j][0].day == 17:
                cell.value = f"{week_dates[j][0].year}/{week_dates[j][0].month}/{week_dates[j][0].day}"
            elif week_dates[j][0].day == 1:
                cell.value = f"{week_dates[j][0].month}/{week_dates[j][0].day}"
                if week_dates[j][0].year == 2025 and week_dates[j][0].month == 5 and week_dates[j][0].day == 1:
                    cell.value = f"{week_dates[j][0].month}/{week_dates[j][0].day}劳动"      
                
                
            else:
                cell.value = f"{week_dates[j][0].day}"
                if week_dates[j][0].year == 2025 and week_dates[j][0].month == 4 and week_dates[j][0].day == 4:
                    cell.value = f"{week_dates[j][0].day}清明"
                elif week_dates[j][0].year == 2025 and week_dates[j][0].month == 5 and week_dates[j][0].day == 31:
                    cell.value = f"{week_dates[j][0].day}端午"
        
        cell.alignment = Alignment(horizontal='center', vertical='center')

        # 根据月份设置单元格底纹颜色
        month = week_dates[j][0].month
        day = week_dates[j][0].day
        if month == 2:
            cell.fill = PatternFill(start_color="FFFFCC", end_color="FFFFCC", fill_type="solid")  # 浅黄色
        elif month == 3:
            cell.fill = PatternFill(start_color="FFCCCC", end_color="FFCCCC", fill_type="solid")  # 浅红色
        elif month == 4:
            if day !=4 :                # 4月4日清明
                cell.fill = PatternFill(start_color="CCFFCC", end_color="CCFFCC", fill_type="solid")  # 浅绿色
        elif month == 5:           
            if not (day == 1 or day == 2 or day == 3 or day == 4 or day == 5):      
                cell.fill = PatternFill(start_color="CCCCCC", end_color="CCCCCC", fill_type="solid")  # 浅灰色
        elif month == 6:
            if not (day == 1 or day == 2 ):    
                cell.fill = PatternFill(start_color="FFCC99", end_color="FFCC99", fill_type="solid")  # 浅橘色
        
        # 设置单元格边框样式为黑色实线
        thin_border = Border(left=Side(style='thin', color='000000'), 
                             right=Side(style='thin', color='000000'), 
                             top=Side(style='thin', color='000000'), 
                             bottom=Side(style='thin', color='000000'))
        cell.border = thin_border
        # 设置字体大小为18磅
        if week_dates[j][0].year == 2025 and week_dates[j][0].month == 2 and week_dates[j][0].day == 17:
            cell.font = Font(size=13)
            cell.alignment = Alignment(horizontal='center', vertical='center')
        else:
            cell.font = Font(size=16)
            cell.alignment = Alignment(horizontal='center', vertical='center')
        
        # 在G2-H2开始的列的单元格都填充为白色
        for row in range(2, sheet.max_row + 1):
            for col in range(7, 9):  # Apply white fill to G2-H2 columns
                cell = sheet.cell(row=row, column=col)
                cell.fill = PatternFill(start_color="FFFFFF", end_color="FFFFFF", fill_type="solid")  # White color

        
        # # 4月27日(周日)换班,4月浅绿色
        # if week_dates[j][0].year == 2025 and week_dates[j][0].month == 4 and week_dates[j][0].day == 27:
        #     print("4月27日已找到")
        #     # 重新填充一个特定单元格为浅绿色
        specific_cell = 'H11' 
        sheet[specific_cell].fill = PatternFill(start_color="CCFFCC", end_color="CCFFCC", fill_type="solid")
            # cell.fill = PatternFill(start_color="CCFFCC", end_color="CCFFCC", fill_type="solid")  # 浅绿色
    
    
    # 更新周数并移动到下一周
    current_week += 1



# 确保标题行的所有单元格也居中且有框线,并将第一行标题单元格底色设置为浅蓝色
for col in range(1, len(title_row) + 1):
    cell = sheet.cell(row=1, column=col)
    cell.alignment = Alignment(horizontal='center', vertical='center')
    thin_border = Border(left=Side(style='thin', color='000000'), 
                         right=Side(style='thin', color='000000'), 
                         top=Side(style='thin', color='000000'), 
                         bottom=Side(style='thin', color='000000'))
    cell.border = thin_border
    if col >= 1 and col <= 8:  # Apply blue fill to A1-H1
        cell.fill = PatternFill(start_color="ADD8E6", end_color="ADD8E6", fill_type="solid")  # 浅蓝色
        cell.font = Font(size=16)



# A列第二行开始,单元格的填充底色与B列单元格颜色相同
# for row in range(2, sheet.max_row + 1):
#     for col in range(1, 2):  # Apply fill from B column to A-H columns
#         b_cell = sheet.cell(row=row, column=col + 1)
#         a_cell = sheet.cell(row=row, column=col)
#         a_cell.fill = b_cell.fill.copy()  # Use copy() to avoid unhashable type error

# 设置所有行的行高和列宽
for row in range(1, sheet.max_row + 2):
    sheet.row_dimensions[row].height = 30

for col in range(1, sheet.max_column + 1):
    column_letter = get_column_letter(col)
    sheet.column_dimensions[column_letter].width = 11.5 # Set width to a reasonable value for better readability




#  在第一行上方插入一个空行,然后合并A1-H1,写入“第二学期”20磅,居中
sheet.insert_rows(1)
sheet.merge_cells('A1:H1')
sheet.cell(row=1, column=1).value = "上海市中小学2024学年度第二学期校历(阿夏20250209)"
sheet.cell(row=1, column=1).alignment = Alignment(horizontal='center', vertical='center')
# 字号,加粗
sheet.cell(row=1, column=1).font = Font(size=18, bold=True)
# 框线
# sheet.cell(row=1, column=1).border = thin_border
# 填充白色
sheet.cell(row=1, column=1).fill = PatternFill(start_color="FFFFFF", end_color="FFFFFF", fill_type="solid") 



# 保存工作簿
workbook.save(path + fr"\{title}.xlsx")
time.sleep(2)


# import pandas as pd
# from fpdf import FPDF

# # 读取Excel文件
# excel_file = path + fr"\{title}.xlsx"
# df = pd.read_excel(excel_file)

# # 创建PDF对象
# pdf = FPDF()
# pdf.add_page()
# pdf.set_font("Arial", size=12)

# # 添加表格数据到PDF
# for i in range(len(df)):
#     line = df.iloc[i].tolist()
#     text = ' | '.join([str(x) for x in line])
#     pdf.cell(200, 10, txt=text, ln=True)

# # 保存PDF文件
# pdf_file = path + fr"\{title}.pdf"
# pdf.output(pdf_file)
# print(f"PDF file has been created: {pdf_file}")

在excel里另存为pdf(python  把excel转PDF有问题)

不同浏览器效果

CAJ

谷歌浏览器

360极速浏览器

火狐浏览器

Adobe Acrobat DC

最终效果

发到学校群里

因为图片里面有彩色的底纹,必须用领导的彩色打印机。

所以我打印了二十份,粘在墙上。需要的人自己来拿

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/967467.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

KERL文献阅读分享:知识图谱与预训练语言模型赋能会话推荐系统

标题期刊年份Knowledge Graphs and Pre-trained Language Models enhanced Representation Learning for Conversational Recommender SystemsJournal of LaTeX Class Files2021 &#x1f4c8;研究背景 在数字时代&#xff0c;个性化推荐系统已经成为了我们生活的一部分。从电…

强一致性算法:Raft

目录 什么是 Raft 算法&#xff1f; Leader的选举 投票分裂后的选举过程 Raft算法日志复制过程 修复不一样的日志 数据安全性的保证 什么是 Raft 算法&#xff1f; Raft 算法是一种是一种用于管理复制日志的强一致性算法&#xff0c;用于保证分布式系统中节点数据的一致…

[MyabtisPlus]PG的TIMESTAMPTZ不支持转换为LocalDateTime

背景 数据库用的是PG&#xff0c;且created_time字段用的是带时区的timestamptz类型&#xff1a; 用MyabtisPlus(MP)的的代码生成&#xff0c;默认生成的是JDK8的LocalDateTime类型&#xff1a; 结果&#xff0c;在查询时候&#xff0c;无法做到实体类的类型自动转换&#xff0…

cliproxy代理服务使用指南

Cliproxy代理服务使用指南 一、引言 Cliproxy&#xff0c;作为一款高效稳定的代理服务工具&#xff0c;广泛应用于跨境电商、数据分析、网络爬虫、远程办公等领域。本指南旨在帮助用户快速上手Cliproxy&#xff0c;充分利用其代理服务&#xff0c;提升工作效率与数据安全。 二、…

【Java 面试 八股文】Redis篇

Redis 1. 什么是缓存穿透&#xff1f;怎么解决&#xff1f;2. 你能介绍一下布隆过滤器吗&#xff1f;3. 什么是缓存击穿&#xff1f;怎么解决&#xff1f;4. 什么是缓存雪崩&#xff1f;怎么解决&#xff1f;5. redis做为缓存&#xff0c;mysql的数据如何与redis进行同步呢&…

防火墙术语大全( Firewalld Glossary of Terms)

防火墙术语大全 防火墙作为网络安全中不可或缺的设备&#xff0c;在各种网络架构中扮演着至关重要的角色。无论是企业级防火墙、云防火墙还是家用路由器内置的防火墙&#xff0c;它们的工作原理和配置策略都离不开一系列专业术语的支撑。对于网络工程师来说&#xff0c;掌握这…

【蓝耘元生代智算云平台】一键部署 DeepSeek人工智能模型

欢迎来到ZyyOvO的博客✨&#xff0c;一个关于探索技术的角落&#xff0c;记录学习的点滴&#x1f4d6;&#xff0c;分享实用的技巧&#x1f6e0;️&#xff0c;偶尔还有一些奇思妙想&#x1f4a1; 本文由ZyyOvO原创✍️&#xff0c;感谢支持❤️&#xff01;请尊重原创&#x1…

配置@别名路径,把@/ 解析为 src/

路径解析配置 webpack 安装 craco npm i -D craco/craco 项目根目录下创建文件 craco.config.js &#xff0c;内容如下 const path require(path) module.exports {webpack: {// 配置别名alias: {// 约定&#xff1a; 使用 表示src文件所在路径: path.resolve(__dirname,src)…

力扣hot100刷题第一天

哈希 1. 两数之和 题目 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标值 target 的那 两个 整数&#xff0c;并返回它们的数组下标。 你可以假设每种输入只会对应一个答案&#xff0c;并且你不能使用两次相同的元素。你可以按任意…

【前端】几种常见的跨域解决方案代理的概念

几种常见的跨域解决方案&代理的概念 一、常见的跨域解决方案1. 服务端配置CORS&#xff08;Cross-Origin Resource Sharing&#xff09;&#xff1a;2. Nginx代理3. Vue CLI配置代理&#xff1a;4 .uni-app在manifest.json中配置代理来解决&#xff1a;5. 使用WebSocket通讯…

以下是基于巨控GRM241Q-4I4D4QHE模块的液位远程控制系统技术方案:

以下是基于巨控GRM241Q-4I4D4QHE模块的液位远程控制系统技术方案&#xff1a; 一、系统概述 本系统采用双巨控GRM241Q模块构建4G无线物联网络&#xff0c;实现山上液位数据实时传输至山下水泵站&#xff0c;通过预设逻辑自动控制水泵启停&#xff0c;同时支持APP远程监控及人工…

百度高德地图坐标转换

百度地图和高德地图的侧重点不太一样。同样一个地名&#xff0c;在百度地图网站上搜索到的地点可能是商业网点&#xff0c;在高德地图网站上搜索到的地点可能是自然行政地点。 高德地图api 在高德地图中&#xff0c;搜索地名&#xff0c;如“乱石头川”&#xff0c;该地名会出…

Photoshop自定义键盘快捷键

编辑 - 键盘快捷键 CtrlShiftAltK 把画笔工具改成Q , 橡皮擦改成W , 涂抹工具改成E , 增加和减小画笔大小A和S 偏好设置 - 透明度和色域 设置一样颜色 套索工具 可以自定义套选一片区域 Shiftf5 填充 CtrlU 可以改颜色/色相/饱和度 CtrlE 合并图层 CtrlShiftS 另存…

carbon 加入 GitCode:Golang 时间处理的 “瑞士军刀”

在 Golang 的开发生态中&#xff0c;时间处理领域长期存在着诸多挑战。高效、精准的时间处理对于各类软件应用的稳定运行与功能拓展至关重要。近日&#xff0c;carbon 正式加入 GitCode&#xff0c;为 Golang 开发者带来一款强大且便捷的时间处理利器&#xff0c;助力项目开发迈…

项目总结: 应用程序的扩展bundle化,自定义classLoader

目录 描述事情实现的简单说明主应用业务1业务2 实现细节描述更多总结 描述事情 应用程序的主逻辑要做一件事&#xff0c;也提供了扩展。即如果想干预这个逻辑&#xff0c;业务可以自己扩展。 设计图如下&#xff1a; 应用&#xff1a;application, AppClassLoader加载&#…

基于javaweb的SpringBoot电影推荐系统

&#x1f3ac; 秋野酱&#xff1a;《个人主页》 &#x1f525; 个人专栏:《Java专栏》《Python专栏》 ⛺️心若有所向往,何惧道阻且长 文章目录 运行环境开发工具适用功能说明项目介绍环境需要技术栈使用说明 运行环境 Java≥8、MySQL≥5.7 开发工具 eclipse/idea/myeclips…

linux部署ollama+deepseek+dify

Ollama 下载源码 curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz sudo tar -C /usr -xzf ollama-linux-amd64.tgz启动 export OLLAMA_HOST0.0.0.0:11434 ollama serve访问ip:11434看到即成功 Ollama is running 手动安装deepseek…

1 推荐系统概述

推荐系统概述 1 推荐系统的意义平台方信息生产者&#xff08;物品&#xff09;信息消费者&#xff08;用户&#xff09;推荐和搜索的区别 2 推荐系统架构系统架构算法架构 3 推荐系统技术栈算法画像层召回/粗排精排重排序 工程 1 推荐系统的意义 信息生产者&#xff08;平台方…

torch_bmm验算及代码测试

文章目录 1. torch_bmm2. pytorch源码 1. torch_bmm torch.bmm的作用是基于batch_size的矩阵乘法,torch.bmm的作用是对应batch位置的矩阵相乘&#xff0c;比如&#xff0c; mat1的第1个位置和mat2的第1个位置进行矩阵相乘得到mat3的第1个位置mat1的第2个位置和mat2的第2个位置…

汽车与AI深度融合:CES Asia 2025前瞻

在科技飞速发展的当下&#xff0c;汽车与AI的融合正成为行业变革的关键驱动力。近日&#xff0c;吉利、极氪、岚图、智己等多家车企纷纷官宣与DeepSeek模型深度融合&#xff0c;其中岚图知音更是将成为首个搭载该模型的量产车型&#xff0c;这无疑是汽车智能化进程中的重要里程…