#迭代器作為輸入源classIterableDataset():def__init__(self, start, end):'''init the class object to hold the data'''self.start = startself.end = enddef__next__(self):'''iter one data and return'''returnnext(self.data)def__iter__(self):'''reset the iter'''self.data =iter(range(self.start, self.end))return self
生成器
直接依賴Python的生成器類型generator返回數據,直至生成器拋出異常
defmy_generator(start, end):for i inrange(start, end):yield i
1. 自定義注釋是基于SpringAOP實現的
Spring AOP(Aspect-Oriented Programming,面向切面編程)是Spring框架中的一個強大功能模塊,它實現了AOP編程模型,允許開發者將橫切關注點(如日志記錄、事務管理、安全…
小和問題和逆序對問題
小和問題,
在一個數組中,每一個數左邊的數中比當前數小的數累加起來,叫做這個數組的小和,求一個數組的小和 直接遍歷:
int littleSum1(int* arr, int L, int R)
{int temp 0;for (int i L; …
繼承Thread類的方式進行實現
public class MyThread extends Thread{
Override
public void run(){//多線程具體業務邏輯}
}在main方法里面創建子類對象,開啟線程
public static void main(String[] args) {MyThread t1 new MyThread();
MyThread t2 new MyThrea…
1.簡單介紹一下大模型【LLMs】? 大模型:一般指1億以上參數的模型,但是這個標準一直在升級,目前萬億參數以上的模型也有了。大語言模型(Large Language Model,LLM)是針對語言的大模型。
2.目前主…