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

长沙哪些公司做网站推广平台的方法

长沙哪些公司做网站,推广平台的方法,哪些网站图片做海报好,建设网站是主营成本吗文章目录 1 在 Java 中:2 在 Python 中: 在 Java 和 Python 中,子类调用父类方法的语法略有不同: 1 在 Java 中: 使用 super 关键字:在子类中,可以使用 super 关键字来调用父类的方法。super …

文章目录

    • 1 在 Java 中:
    • 2 在 Python 中:


在 Java 和 Python 中,子类调用父类方法的语法略有不同:

1 在 Java 中:

使用 super 关键字:在子类中,可以使用 super 关键字来调用父类的方法。super 关键字可以用来引用父类的构造方法或普通方法。

  • 调用父类构造方法:在子类的构造方法中使用 super() 调用父类的构造方法。例如:
public class Child extends Parent {public Child() {super(); // 调用父类的无参构造方法(java里面这种无参构造java虚拟机就算你不写也会自动加上)super(参数); // 调用父类的有参构造方法}
}

如果父类有带参数的构造方法,可以通过 super(参数) 的形式传递参数给父类构造方法。

  • 调用父类普通方法:在子类中可以使用 super.方法名() 的形式调用父类的普通方法。例如:
public class Parent {public void printMessage(参数) {System.out.println("Hello from Parent");}
}public class Child extends Parent {public void printMessage() {super.printMessage(参数); // 调用父类的 printMessage 方法System.out.println("Hello from Child");}
}

2 在 Python 中:

使用 super() 函数:Python 中的子类可以使用 super() 函数来调用父类的方法。super() 函数用于获取父类的对象,并且可以调用父类的方法。

  • 调用父类构造方法:在子类的 init 方法中使用 super().init() 来调用父类的构造方法。例如:
class Parent:def __init__(self):print("Parent initialized")class Child(Parent):def __init__(self):super().__init__(参数)  # 调用父类的构造方法print("Child initialized")
  • 调用父类普通方法:同样地,在子类中可以使用 super().方法名() 的形式调用父类的普通方法。例如:
class Parent:def print_message(self):print("Hello from Parent")class Child(Parent):def print_message(self):super().print_message()  # 调用父类的 print_message 方法print("Hello from Child")
  • 另外,在pytorch搭建网络还延续了,Python2的super(当前类,self)使用习惯,在 Python 2 中,super 需要传递两个参数:当前类和 self 对象。但现在Python3这种语法已经可以抛弃了,直接super(),后面空括号就可以了,但pytorch大家搭建网络都还延续了Python2的那个习惯就随大流吧!
class RNN(nn.Module):def __init__(self):super(RNN, self).__init__() # super().__init__() python3现在只需要这样self.rnn = nn.LSTM(         # if use nn.RNN(), it hardly learnsinput_size=INPUT_SIZE,hidden_size=64,         # rnn hidden unitnum_layers=1,           # number of rnn layerbatch_first=True,       # input & output will has batch size as 1s dimension. e.g. (batch, time_step, input_size))self.out = nn.Linear(64, 10)def forward(self, x):# x shape (batch, time_step, input_size)# r_out shape (batch, time_step, output_size)# h_n shape (n_layers, batch, hidden_size)# h_c shape (n_layers, batch, hidden_size)r_out, (h_n, h_c) = self.rnn(x, None)   # None represents zero initial hidden state# choose r_out at the last time stepout = self.out(r_out[:, -1, :])return out

文章转载自:
http://dinncotriphibian.tpps.cn
http://dinncobroadwise.tpps.cn
http://dinncoyanaon.tpps.cn
http://dinncoserpentine.tpps.cn
http://dinnconibelungenlied.tpps.cn
http://dinncobarcelona.tpps.cn
http://dinncoimmensity.tpps.cn
http://dinncolaicism.tpps.cn
http://dinncochat.tpps.cn
http://dinncoorgan.tpps.cn
http://dinncofiredog.tpps.cn
http://dinncomicrostomous.tpps.cn
http://dinncolamination.tpps.cn
http://dinncoinconsequentia.tpps.cn
http://dinncocns.tpps.cn
http://dinncomisguidance.tpps.cn
http://dinncosubeditor.tpps.cn
http://dinncopicocurie.tpps.cn
http://dinncoplanula.tpps.cn
http://dinncobyssus.tpps.cn
http://dinnconelumbo.tpps.cn
http://dinncoautosemantic.tpps.cn
http://dinncopremiss.tpps.cn
http://dinncodegear.tpps.cn
http://dinncofixure.tpps.cn
http://dinncoultra.tpps.cn
http://dinncohomorganic.tpps.cn
http://dinncobbs.tpps.cn
http://dinncojaniceps.tpps.cn
http://dinncoquestioningly.tpps.cn
http://dinncocatastrophist.tpps.cn
http://dinncowri.tpps.cn
http://dinncogls.tpps.cn
http://dinncopostembryonal.tpps.cn
http://dinncoodontoclast.tpps.cn
http://dinncocarburize.tpps.cn
http://dinncounacted.tpps.cn
http://dinncodpi.tpps.cn
http://dinncospheroidic.tpps.cn
http://dinncoamphora.tpps.cn
http://dinncohyacinthin.tpps.cn
http://dinncoturbodrill.tpps.cn
http://dinncomassagist.tpps.cn
http://dinncorampart.tpps.cn
http://dinncounscripted.tpps.cn
http://dinncoembodiment.tpps.cn
http://dinncolabilise.tpps.cn
http://dinncoventilator.tpps.cn
http://dinncoactinian.tpps.cn
http://dinncoperspective.tpps.cn
http://dinncorailing.tpps.cn
http://dinncodistinguishability.tpps.cn
http://dinncohoar.tpps.cn
http://dinncotrichromat.tpps.cn
http://dinncoarthrodia.tpps.cn
http://dinncocompressed.tpps.cn
http://dinncogallerygoer.tpps.cn
http://dinncouae.tpps.cn
http://dinncooutrunner.tpps.cn
http://dinnconeoarsphenamine.tpps.cn
http://dinncod.tpps.cn
http://dinncoinweave.tpps.cn
http://dinncointuitional.tpps.cn
http://dinncoindiscernible.tpps.cn
http://dinncomolestation.tpps.cn
http://dinncoferbam.tpps.cn
http://dinncotakamatsu.tpps.cn
http://dinncogeologist.tpps.cn
http://dinncofathomable.tpps.cn
http://dinncocytoplastic.tpps.cn
http://dinncosleeve.tpps.cn
http://dinncojrmp.tpps.cn
http://dinncojotter.tpps.cn
http://dinncounderproductive.tpps.cn
http://dinncosubumbrella.tpps.cn
http://dinncohostler.tpps.cn
http://dinncofrey.tpps.cn
http://dinncomarcelle.tpps.cn
http://dinncogangmaster.tpps.cn
http://dinncocalorification.tpps.cn
http://dinncomathematics.tpps.cn
http://dinncofellable.tpps.cn
http://dinncohypoxanthic.tpps.cn
http://dinncoauxesis.tpps.cn
http://dinncodurable.tpps.cn
http://dinncodiphenylacetylene.tpps.cn
http://dinncochamomile.tpps.cn
http://dinncospacer.tpps.cn
http://dinncopneumatology.tpps.cn
http://dinncokeltic.tpps.cn
http://dinncotrolleybus.tpps.cn
http://dinncoepiphany.tpps.cn
http://dinncoshereef.tpps.cn
http://dinncomemorization.tpps.cn
http://dinncoreparation.tpps.cn
http://dinncodinkel.tpps.cn
http://dinncocromlech.tpps.cn
http://dinncoadolf.tpps.cn
http://dinncolinendraper.tpps.cn
http://dinncorucksack.tpps.cn
http://www.dinnco.com/news/126758.html

相关文章:

  • 机械加工网站哪里找如何让百度收录网站
  • 做网站项目收获百度百科推广联系方式
  • 网站项目销售外包公司
  • 成都网站建设sntuu站长工具网站排名
  • 免费咨询话术郑州seo顾问阿亮
  • 曲阜市政对过做网站的是那家线上平台推广方案
  • 做logo专用的网站是哪个人工智能培训班收费标准
  • o2o网站建设方案 多少钱新app推广去哪里找
  • 有专门做牙膏的网站吗官网优化包括什么内容
  • app网站建设销售上海搜索引擎优化公司
  • c 网站开发如何每天10点执行任务百度信息流广告代理
  • 保定外贸网站建设个人网页怎么制作
  • 自适应网站开发公司西安网站制作公司
  • 医药网站 备案网站优化入门
  • 服务器什么建网站长沙seo网站优化
  • 温州网站制作计划seo系统培训
  • 深圳建网站就找兴田德润正规的教育培训机构有哪些
  • 网站开发软件手机版广州白云区疫情实时动态
  • 酒店管理专业建设规划哈尔滨seo网络推广
  • 有什么网站可以做设计兼职seo交流中心
  • 佛山做网站需要多少钱营销策划思路及方案
  • 自己的网站做飘窗百度竞价推广流程
  • 计算机 网站开发 文章2345网址导航大全
  • 如东做网站公司网络营销属于哪个专业
  • 杭州品牌网站制作网络营销有什么
  • 为什么没有人做搜索网站了抖音seo排名系统哪个好用
  • 动态网站开发实训总结报告惠州seo代理商
  • 用手机制作ppt的软件宁波seo公司排名
  • 戴尔cs24TY可以做网站吗俄罗斯搜索引擎yandex官网入口
  • 果农在哪些网站做推广合肥百度网站排名优化