zl程序教程

您现在的位置是:首页 >  后端

当前栏目

python语言学习:python语言学习中的定义类、定义函数、封装api等详细攻略

Python封装学习语言API 函数 详细 定义
2023-09-14 09:04:48 时间

python语言学习:python语言学习中的定义类、定义函数、封装api等详细攻略

 

 

目录

python语言学习中的定义类

python语言学习中的定义函数

python语言学习中封装api


 

 

 

python语言学习中的定义类

1、定义类的结构形式

class LSTMRNN(object):
    # __init__()方法: 用来传入各种参数
    def __init__(self, n_steps, input_size, output_size, cell_size, batch_size):
        '''
        :param n_steps: 每批数据总包含多少时间刻度,详看博客,LSTM每一个batchz内,需要3步

        '''
        self.n_steps = n_steps          
        self.input_size = input_size
        self.output_size = output_size
        self.cell_size = cell_size
        self.batch_size = batch_size

    #add_input_layer()方法:用来增加一个输入层
    def add_input_layer(self,):
        pass

 

python语言学习中的定义函数

1、pass   #放在函数内,执行空语句

 

 

 

python语言学习中封装api