Torch的函数
来源:互联网 发布:正交矩阵的行列式 编辑:程序博客网 时间:2024/06/06 02:21
- torch.typename()
- torch.class()
新建文件game.lua,其中包含两个类。输入如下
require 'torch'local father=torch.class('father')function father:__init() self.contents = "this is father\n"endfunction father:print() print(self.contents)endfunction father:bip() print("bip bip.................!")endlocal child,parent = torch.class('torch.child','father')function child:__init(stuff) parent.__init(self) self.stuff = stuffendfunction child:boing() print("boing boing...............!")endfunction child:print() print(self.contents) print(self.stuff)end
在同一目录下新建test.lua,输入如下
require "game"b=torch.child('1234')b:print()b:boing()b:bip()
参考文献:
阅读全文
0 0
- Torch的函数
- torch.gt函数的用法
- torch中cmul()函数的用法总结
- torch中cmul()函数的用法总结
- [torch]nn内部函数?
- torch入门笔记1:torch的使用
- torch 安装的问题
- torch
- Torch
- Torch
- Torch
- Torch
- Torch
- Torch
- torch中narrow的用法
- Torch的安装和学习
- [torch]安装遇到的问题
- torch入门笔记7:Torch的入门使用
- 统计自然语言处理1 ------绪论(一)
- POJ 2031
- react-navigation
- 微信分享详解
- MNIST初级入门解读
- Torch的函数
- 让自己的电脑变成网站服务器(亲测成功)
- HDU 5773 The All-purpose Zero【LIS变形】
- Android事件分发
- Android 下拉刷新库,这一个就够了!
- java:竟然有会生成固定文字“hello world”的随机数
- 初始化mysql数据库提示缺少Data:dumper模块解决方法
- 如何获取 docker 容器(container)的 ip 地址
- 我的第一篇博客