mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
corrections/additions to dok
This commit is contained in:
parent
bbf3970981
commit
4a906fbff2
|
|
@ -82,20 +82,50 @@ stroption mycustomstring
|
|||
and the output will be logged in
|
||||
''experiment,seed=456,stroption=mycustomstring/log''
|
||||
|
||||
==== text(string) ====
|
||||
{{anchor:torch.CmdLine.text}}
|
||||
Logs a custom text message.
|
||||
==== addTime([name] [,format]) ====
|
||||
{{anchor:torch.CmdLine.addtime}}
|
||||
|
||||
Adds a prefix to every line in the log file with the date/time in the
|
||||
given format with an optional name argument. The date/time format is
|
||||
the same as ''os.date()''. Note that the prefix is only added to the
|
||||
log file, not the screen output. The default value for name is empty
|
||||
and the default format is '%F %T'.
|
||||
|
||||
The final produced output for the following command is:
|
||||
|
||||
<file lua>
|
||||
> cmd:addTime('your project name','%F %T')
|
||||
> print('Your log message')
|
||||
</file>
|
||||
|
||||
<file>
|
||||
2012-02-07 08:21:56[your project name]: Your log message
|
||||
</file>
|
||||
|
||||
==== log(filename, parameter_table) ====
|
||||
{{anchor:torch.CmdLine.log}}
|
||||
|
||||
It sets the log filename to ''filename'' and prints the values of
|
||||
parameters in the ''parameter_table''.
|
||||
|
||||
==== option(name, default, help) ====
|
||||
{{anchor:torch.CmdLine.option}}
|
||||
|
||||
Stores an option argument. The name should always start with '-'.
|
||||
|
||||
==== [table] parse(arg) ====
|
||||
{{anchor:torch.CmdLine.parse}}
|
||||
|
||||
Parses a given table, ''arg'' is by default the argument table that
|
||||
is created by ''lua'' using the command line arguments passed to the
|
||||
executable. Returns a table of option values.
|
||||
|
||||
==== silent() ====
|
||||
{{anchor:torch.CmdLine.silent}}
|
||||
|
||||
Silences the output to standard output. The only output is written to
|
||||
the log file.
|
||||
|
||||
==== [string] string(prefix, params, ignore) ====
|
||||
{{anchor:torch.CmdLine.string}}
|
||||
|
||||
|
|
@ -107,9 +137,9 @@ string representation.
|
|||
This function is usefull for creating unique experiment directories that
|
||||
depend on the parameter settings.
|
||||
|
||||
==== log(filename, parameter_table) ====
|
||||
{{anchor:torch.CmdLine.log}}
|
||||
==== text(string) ====
|
||||
{{anchor:torch.CmdLine.text}}
|
||||
|
||||
Logs a custom text message.
|
||||
|
||||
It set the log filename to ''filename'' and prints the values of
|
||||
parameters in the ''parameter_table''.
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@ useful utilities.
|
|||
===== Torch Packages =====
|
||||
{{anchor:torch.reference.dok}}
|
||||
|
||||
* Tensor Library
|
||||
* [[Tensor|Tensor]] defines the //all powerful// tensor object that prvides multi-dimensional numerical arrays with type templating.
|
||||
* [[maths|Mathemetical operations]] that are defined for the tensor object types.
|
||||
* [[Storage|Storage]] defines a simple storage interface that controls the underlying storage for any tensor object.
|
||||
* File I/O Interface Library
|
||||
* [[File|File]] is an abstract interface for common file operations.
|
||||
* [[DiskFile|Disk File]] defines operations on files stored on disk.
|
||||
* [[MemoryFile|Memory File]] defines operations on stored in RAM.
|
||||
* [[PipeFile|Pipe File]] defines operations for using piped commands.
|
||||
* Tensor Library
|
||||
* [[Storage|Storage]] defines a simple storage interface that controls the underlying storage for any tensor object.
|
||||
* [[Tensor|Tensor]] defines the //all powerful// tensor object that prvides multi-dimensional numerical arrays with type templating.
|
||||
* [[maths|Mathemetical operations]] that are defined for the tensor object types.
|
||||
* Useful Utilities
|
||||
* [[Timer|Timer]] provides functionality for //measuring time//.
|
||||
* [[Tester|Tester]] is a generic tester framework.
|
||||
|
|
|
|||
|
|
@ -191,13 +191,11 @@ tables (or Torch objects) have the same address in memory. Returns ''false'' in
|
|||
A Torch class is a class created with [[#TorchClass|torch.class()]] or
|
||||
[[#torch.newmetatable|torch.newmetatable()]].
|
||||
|
||||
===== torch.setenv(function or userdata, table) =====
|
||||
{{anchor:torch.setenv}}
|
||||
===== [string] torch.getdefaulttensortype() =====
|
||||
{{anchor:torch.getdefaulttensortype}}
|
||||
|
||||
Assign ''table'' as the Lua environment of the given ''function'' or the given
|
||||
''userdata''. To know more about environments, please read the documentation
|
||||
of [[http://www.lua.org/manual/5.1/manual.html#lua_setfenv|lua_setfenv()]]
|
||||
and [[http://www.lua.org/manual/5.1/manual.html#lua_getfenv|lua_getfenv()]].
|
||||
Returns a string representing the default tensor type currently in use
|
||||
by Torch7.
|
||||
|
||||
===== [table] torch.getenv(function or userdata) =====
|
||||
{{anchor:torch.getenv}}
|
||||
|
|
@ -221,11 +219,32 @@ object, a table, a thread or a function.
|
|||
|
||||
This is different from the //class// id returned by [[#torch.id|torch.id()]].
|
||||
|
||||
===== torch.setdefaulttensortype([typename]) =====
|
||||
{{anchor:torch.setdefaulttensortype}}
|
||||
|
||||
Sets the default tensor type for all the tensors allocated from this
|
||||
point on. Valid types are:
|
||||
* ''ByteTensor''
|
||||
* ''CharTensor''
|
||||
* ''ShortTensor''
|
||||
* ''IntTensor''
|
||||
* ''FloatTensor''
|
||||
* ''DoubleTensor''
|
||||
|
||||
===== torch.setenv(function or userdata, table) =====
|
||||
{{anchor:torch.setenv}}
|
||||
|
||||
Assign ''table'' as the Lua environment of the given ''function'' or the given
|
||||
''userdata''. To know more about environments, please read the documentation
|
||||
of [[http://www.lua.org/manual/5.1/manual.html#lua_setfenv|lua_setfenv()]]
|
||||
and [[http://www.lua.org/manual/5.1/manual.html#lua_getfenv|lua_getfenv()]].
|
||||
|
||||
===== [object] torch.setmetatable(table, classname) =====
|
||||
{{anchor:torch.setmetatable}}
|
||||
|
||||
Set the metatable of the given ''table'' to the metatable of the Torch object named ''classname''.
|
||||
This function has to be used with a lot of care.
|
||||
Set the metatable of the given ''table'' to the metatable of the Torch
|
||||
object named ''classname''. This function has to be used with a lot
|
||||
of care.
|
||||
|
||||
===== [table] torch.getconstructortable(string) =====
|
||||
{{anchor:torch.getconstructortable}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user