最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

对应老买买提的军事天地,观点交锋比较激烈,反驳不留情面,请作好心理准备。因为此版帖子太多,所以新帖不出现在首页新帖列表,防止首页新帖刷屏太快。


版主: Softfist

dramaking
著名写手
著名写手
帖子互动: 21
帖子: 290
注册时间: 2022年 8月 9日 18:34

#21 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 dramaking »

醒醒,chatgpt的原班领导船截止昨天只剩下奥特曼一人了。
x1 图片
rihai(temp)
论坛元老
论坛元老
帖子互动: 891
帖子: 22588
注册时间: 2022年 8月 16日 00:45

#22 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 rihai(temp) »

大文儿比聊天狗屁通牛逼多了
你这等于是帮聊天狗屁通一步一步debug
大文儿直接帮你debug好了
LOL

LittleBear 写了: 2024年 9月 26日 19:15 1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来

2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。

3,接着让chatgpt写个新版本,立马就完成了。

4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。

码工真的可以进历史的垃圾堆了。呵呵
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#23 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

rihai 写了: 2024年 9月 26日 21:21 大文儿比聊天狗屁通牛逼多了
你这等于是帮聊天狗屁通一步一步debug
大文儿直接帮你debug好了
LOL
什么是大文儿?
头像
huangchong(净坛使者)
论坛元老
论坛元老
2023-24年度优秀版主
帖子互动: 4005
帖子: 60193
注册时间: 2022年 7月 22日 01:22

#24 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 huangchong(净坛使者) »

觉得chatgpt好用,说明你的应用很浅
x1 图片
wonderstreet
论坛支柱
论坛支柱
帖子互动: 294
帖子: 11460
注册时间: 2022年 7月 27日 00:46

#25 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 wonderstreet »

greg brockman还在啊
dramaking 写了: 2024年 9月 26日 21:14 醒醒,chatgpt的原班领导船截止昨天只剩下奥特曼一人了。
dramaking
著名写手
著名写手
帖子互动: 21
帖子: 290
注册时间: 2022年 8月 9日 18:34

#26 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 dramaking »

早就无限期休假去了,还非得把话说破?
wonderstreet 写了: 2024年 9月 26日 21:49 greg brockman还在啊
wonderstreet
论坛支柱
论坛支柱
帖子互动: 294
帖子: 11460
注册时间: 2022年 7月 27日 00:46

#27 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 wonderstreet »

你有内幕?不妨说来
dramaking 写了: 2024年 9月 26日 21:51 早就无限期休假去了,还非得把话说破?
newday_
修改邮箱后未激活修改邮箱后未激活
帖子互动: 4
帖子: 148
注册时间: 2024年 9月 22日 13:38

#28 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 newday_ »

huangchong 写了: 2024年 9月 26日 21:38 觉得chatgpt好用,说明你的应用很浅
Yes
上次由 newday_ 在 2024年 9月 28日 00:43 修改。
沧浪之水清兮,可以濯我缨;沧浪之水浊兮,可以濯我足
newday_
修改邮箱后未激活修改邮箱后未激活
帖子互动: 4
帖子: 148
注册时间: 2024年 9月 22日 13:38

#29 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 newday_ »

LittleBear 写了: 2024年 9月 26日 19:33 有了现成的,调试起来就很快了。
瞎扯,如果10000个bug在里面,调死你
信不信有可能bug越调越多

还不如自己从头写
沧浪之水清兮,可以濯我缨;沧浪之水浊兮,可以濯我足
头像
newIdRobot(新器人)
论坛支柱
论坛支柱
帖子互动: 389
帖子: 12668
注册时间: 2022年 7月 21日 21:29

#30 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 newIdRobot(新器人) »

LittleBear 写了: 2024年 9月 26日 19:15 1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来

2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。

3,接着让chatgpt写个新版本,立马就完成了。

4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。

码工真的可以进历史的垃圾堆了。呵呵
openai快倒閉了
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#31 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

newIdRobot 写了: 2024年 9月 26日 22:12 openai快倒閉了
没关系。自动写程序的工具现在已经一大堆了
shaqima(表格)
知名人士
知名人士
帖子互动: 1
帖子: 78
注册时间: 2022年 8月 2日 21:57

#32 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 shaqima(表格) »

你让它写个cuda呗
LittleBear 写了: 2024年 9月 26日 19:15 1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来

2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。

3,接着让chatgpt写个新版本,立马就完成了。

4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。

码工真的可以进历史的垃圾堆了。呵呵
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#33 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

shaqima 写了: 2024年 9月 27日 01:57 你让它写个cuda呗
Certainly! Below is a simple example of a CUDA program written in **CUDA C**. The program performs a basic operation of adding two arrays (vectors) element by element on the **GPU**.

### Example: CUDA Program to Add Two Vectors

```cpp
#include <iostream>
#include <cuda_runtime.h>

// CUDA Kernel to add elements of two arrays
__global__ void vectorAdd(const int* A, const int* B, int* C, int N) {
int idx = threadIdx.x + blockIdx.x * blockDim.x;
if (idx < N) {
C[idx] = A[idx] + B[idx];
}
}

int main() {
// Number of elements in arrays
int N = 1000;

// Size of the arrays in bytes
size_t size = N * sizeof(int);

// Allocate memory on the host (CPU)
int* h_A = (int*)malloc(size);
int* h_B = (int*)malloc(size);
int* h_C = (int*)malloc(size);

// Initialize arrays on the host
for (int i = 0; i < N; ++i) {
h_A = i;
h_B = i * 2;
}

// Allocate memory on the device (GPU)
int* d_A;
int* d_B;
int* d_C;
cudaMalloc(&d_A, size);
cudaMalloc(&d_B, size);
cudaMalloc(&d_C, size);

// Copy arrays from host to device
cudaMemcpy(d_A, h_A, size, cudaMemcpyHostToDevice);
cudaMemcpy(d_B, h_B, size, cudaMemcpyHostToDevice);

// Define the number of threads and blocks
int threadsPerBlock = 256;
int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock;

// Launch the CUDA kernel
vectorAdd<<<blocksPerGrid, threadsPerBlock>>>(d_A, d_B, d_C, N);

// Copy result from device to host
cudaMemcpy(h_C, d_C, size, cudaMemcpyDeviceToHost);

// Verify the result
for (int i = 0; i < N; ++i) {
if (h_C != h_A + h_B) {
std::cerr << "Error at index " << i << std::endl;
break;
}
}

// Free memory on device and host
cudaFree(d_A);
cudaFree(d_B);
cudaFree(d_C);
free(h_A);
free(h_B);
free(h_C);

std::cout << "Vector addition completed successfully!" << std::endl;
return 0;
}
```

### Explanation of the Code:

1. **CUDA Kernel Function (`vectorAdd`)**:
- This function is executed on the GPU. The `__global__` keyword indicates that the function runs on the device (GPU) and can be called from the host (CPU).
- Each thread computes one element of the result by adding corresponding elements of arrays `A` and `B` and storing the result in array `C`.

2. **Host Code**:
- The CPU initializes the arrays `A` and `B` and allocates memory for the arrays `A`, `B`, and `C` on the GPU.
- The `cudaMalloc()` function allocates memory on the GPU, and `cudaMemcpy()` transfers data between host and device memory.
- The kernel `vectorAdd<<<blocksPerGrid, threadsPerBlock>>>` is launched, with each thread handling one element of the arrays.

3. **Threads and Blocks**:
- The number of threads per block is set to 256, and the number of blocks is calculated to ensure all elements are covered.
- The `threadIdx.x` gives the index of the thread within the block, and `blockIdx.x` gives the index of the block.

4. **Memory Management**:
- After the computation is completed, the result is copied back from the GPU to the CPU, and memory is freed on both the CPU and GPU.

### How to Compile and Run the Code:
To compile and run this CUDA program, you need to have an NVIDIA GPU with CUDA installed. You can use `nvcc`, the CUDA compiler, to compile the code:

```bash
nvcc vector_add.cu -o vector_add
./vector_add
```

If everything is set up correctly, the program will output "Vector addition completed successfully!" after performing the addition on the GPU.

Let me know if you need further clarifications or modifications!
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#34 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

shaqima 写了: 2024年 9月 27日 01:57 你让它写个cuda呗

写好了,评价一下?
xiaoju(可爱的龙猫)
论坛元老
论坛元老
帖子互动: 1049
帖子: 25704
注册时间: 2023年 9月 5日 20:18

#35 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 xiaoju(可爱的龙猫) »

码农的主要责任从来不是写代码,而是判断代码正确性

而程序正确性的检查是不可计算问题,无法使用确定算法完成
LittleBear 写了: 2024年 9月 26日 19:15 1,无论你希望要什么样的神经网络,只需要大致跟chatgpt说一下,马上就可以写出来

2,然后在jupyter notebook上调试,通不过就把error message发给chatgpt,立马就告诉你哪里错了。

3,接着让chatgpt写个新版本,立马就完成了。

4,再把新版本黏贴到jupyter notebook里面,很快就调试好了。

码工真的可以进历史的垃圾堆了。呵呵
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#36 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

xiaoju 写了: 2024年 9月 27日 07:24 码农的主要责任从来不是写代码,而是判断代码正确性

而程序正确性的检查是不可计算问题,无法使用确定算法完成
你说说哪里错了?
xiaoju(可爱的龙猫)
论坛元老
论坛元老
帖子互动: 1049
帖子: 25704
注册时间: 2023年 9月 5日 20:18

#37 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 xiaoju(可爱的龙猫) »

程序的正确性是不可通过确定算法判定的,这是数学定理
LittleBear 写了: 2024年 9月 27日 07:26 你说说哪里错了?
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#38 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

xiaoju 写了: 2024年 9月 27日 07:28 程序的正确性是不可通过确定算法判定的,这是数学定理

原来开发一款软件,是否成功时数学定理决定的?

这么多年的软件公司搞软件都是看数学定理,不是看市场反应?
xiaoju(可爱的龙猫)
论坛元老
论坛元老
帖子互动: 1049
帖子: 25704
注册时间: 2023年 9月 5日 20:18

#39 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 xiaoju(可爱的龙猫) »

这个定理告诉你,不可能用任何算法生成运行正确的软件
LittleBear 写了: 2024年 9月 27日 08:10 原来开发一款软件,是否成功时数学定理决定的?

这么多年的软件公司搞软件都是看数学定理,不是看市场反应?
头像
LittleBear(小破熊)楼主
论坛元老
论坛元老
帖子互动: 778
帖子: 21548
注册时间: 2023年 4月 19日 17:47

#40 Re: 最近学Deep Learning感觉chatgpt写code太爽了,码工可以进历史垃圾堆了

帖子 LittleBear(小破熊)楼主 »

xiaoju 写了: 2024年 9月 27日 08:20 这个定理告诉你,不可能用任何算法生成运行正确的软件
我已经用上了
回复

回到 “军事天地(Military)”