Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLambdaWill <574819595@qq.com>2017-07-20 17:56:09 +0300
committerSoumith Chintala <soumith@gmail.com>2017-07-20 17:56:09 +0300
commitaed31711c6b8846b8337a263a7f9f998697994e7 (patch)
tree3c58e048a4e6ed9ddc4969a33bdf16c518301665
parent1aba9998f11c9ecdab79925c3706cf92e9be3d7d (diff)
update docs (#1062)
* Update tensor.md * Update maths.md * Update tester.md * Update timer.md * Update random.md * Update random.md * Update file.md * revert random.md * Update pipefile.md
-rw-r--r--doc/file.md14
-rwxr-xr-xdoc/maths.md26
-rw-r--r--doc/pipefile.md4
-rw-r--r--doc/random.md4
-rw-r--r--doc/tensor.md2
-rw-r--r--doc/tester.md42
-rw-r--r--doc/timer.md6
7 files changed, 49 insertions, 49 deletions
diff --git a/doc/file.md b/doc/file.md
index c4aa742..accaa35 100644
--- a/doc/file.md
+++ b/doc/file.md
@@ -127,8 +127,8 @@ Serializable objects are `Torch` objects having a `read()` and
If the object to save contains several other objects (let say it is a tree
of objects), then objects appearing several times in this tree will be
-_saved only once_. This saves disk space, speedup loading/saving and
-respect the dependencies between objects.
+_saved only once_. This saves disk space, speeds up loading/saving and
+respects the dependencies between objects.
Interestingly, if the `File` is a [MemoryFile](memoryfile.md), it allows
the user to easily make a _clone_ of any serializable object:
@@ -188,7 +188,7 @@ If the object has been already written in the file, only a _reference_ to
this already saved object will be written: this saves space an speed-up
writing; it also allows to keep the dependencies between objects intact.
-In returns, if one writes an object, modify its member, and write the
+In returns, if one writes an object, modifies its member, and writes the
object again in the same file, the modifications will not be recorded
in the file, as only a reference to the original will be written. See
[readObject()](#torch.File.readObject) for an example.
@@ -196,14 +196,14 @@ in the file, as only a reference to the original will be written. See
<a name="torch.File.readString"></a>
### [string] readString(format) ###
-If `format` starts with ''"*l"` then returns the next line in the `File''. The end-of-line character is skipped.
+If `format` starts with `"*l"` then returns the next line in the `File`. The end-of-line character is skipped.
-If `format` starts with ''"*a"` then returns all the remaining contents of the `File''.
+If `format` starts with `"*a"` then returns all the remaining contents of the `File`.
If no data is available, then an error is raised, except if `File` is in [quiet()](#torch.File.quiet) mode where
it then returns an empty string `''` and after that you'll be able to see that last reading failed due to end of file with your_file:[hasError()](#torch.File.hasError).
-Because Torch is more precise on number typing, the `Lua` format ''"*n"'' is not supported:
+Because Torch is more precise on number typing, the `Lua` format `"*n"` is not supported:
instead use one of the [number read methods](#torch.File.read).
<a name="torch.File.writeString"></a>
@@ -361,4 +361,4 @@ behaviour.
<a name="torch.File.isReferenced"></a>
### isReferenced() ###
-Return the state set by [referenced](#torch.File.referenced).
+Returns the state set by [referenced](#torch.File.referenced).
diff --git a/doc/maths.md b/doc/maths.md
index 85abda4..9cf29bc 100755
--- a/doc/maths.md
+++ b/doc/maths.md
@@ -170,7 +170,7 @@ By default the elements are sorted into 100 equally spaced bins between the mini
`y = torch.bhistc(x, n, min, max)` same as above with `n` bins and `[min, max]` as elements range.
```lua
-x =torch.Tensor(3, 6)
+x = torch.Tensor(3, 6)
> x[1] = torch.Tensor{ 2, 4, 2, 2, 5, 4 }
> x[2] = torch.Tensor{ 3, 5, 1, 5, 3, 5 }
@@ -267,14 +267,14 @@ The sampling is done through a technique defined in a very simple way in this bl
The `output` `Tensor` that is fed into the `multinomialAlias` method need not be contiguous. The `output` tensor can only be a 1d tensor. If you are required to fill a nd tensor enter a 1d view of the same tensor. This method is exceptionally faster than `torch.multinomial` when you want to sample a lot of samples from the same distrbution or sample from the same distribution a large number of times. `torch.multinomial` is faster for sampling few samples from a distribution once because the `multinomialAliasSetup` method takes some time in this case. To see and compare how these two methods differ in speed run `th test/test_aliasMultinomial.lua`.
```lua
-th> state = torch.multinomialAliasSetup(probs)
-th> state
+> state = torch.multinomialAliasSetup(probs)
+> state
{
1 : LongTensor - size: 4
2 : DoubleTensor - size: 4
}
-th> output = torch.LongTensor(2,3)
-th> torch.multinomialAlias(output:view(-1), state)
+> output = torch.LongTensor(2,3)
+> torch.multinomialAlias(output:view(-1), state)
4
1
2
@@ -282,7 +282,7 @@ th> torch.multinomialAlias(output:view(-1), state)
2
2
[torch.LongTensor of size 6]
-th> output
+> output
4 1 2
3 2 2
[torch.LongTensor of size 2x3]
@@ -290,17 +290,17 @@ th> output
You can also allocate memory and reuse it for the state table.
-```
-th> state = {torch.LongTensor(), torch.DoubleTensor()}
-th> probs = torch.DoubleTensor({0.2, 0.3, 0.5})
-th> state = torch.multinomialAliasSetup(probs, state)
-th> state
+```lua
+> state = {torch.LongTensor(), torch.DoubleTensor()}
+> probs = torch.DoubleTensor({0.2, 0.3, 0.5})
+> state = torch.multinomialAliasSetup(probs, state)
+> state
{
1 : LongTensor - size: 3
2 : DoubleTensor - size: 3
}
-th> output = torch.LongTensor(7)
-th> torch.multinomialAlias(output, state)
+> output = torch.LongTensor(7)
+> torch.multinomialAlias(output, state)
2
2
3
diff --git a/doc/pipefile.md b/doc/pipefile.md
index fdba14c..15b9cda 100644
--- a/doc/pipefile.md
+++ b/doc/pipefile.md
@@ -13,8 +13,8 @@ given to the [torch.PipeFile(fileName, mode)](#torch.PipeFile). Read-write mode
<a name="torch.PipeFile"></a>
### torch.PipeFile(command, [mode], [quiet]) ###
-_Constructor_ which execute `command` by opening a pipe in read or write
-`mode`. Valid `mode` are `"r"` (read) or `"w"` (write). Default is read
+_Constructor_ which executes `command` by opening a pipe in read or write
+`mode`. Valid `mode`s are `"r"` (read) or `"w"` (write). Default is read
mode.
If (and only if) `quiet` is `true`, no error will be raised in case of
diff --git a/doc/random.md b/doc/random.md
index 2bb2d1f..235c6f6 100644
--- a/doc/random.md
+++ b/doc/random.md
@@ -120,10 +120,10 @@ random numbers is produced.
<a name="torch.setRNGState"></a>
### [Tensor] setRNGState([gen,] state) ###
-Set the state of the random number generator. If `state` was obtained earlier
+Sets the state of the random number generator. If `state` was obtained earlier
using `getRNGState` then the random number generator should now generate the
same numbers as it did from the point where `state` was obtained. This function
-returns its argument, `state`.
+returns its argument `state`.
<a name="torch.random"></a>
### [number] random([gen,] [a], [b]) ###
diff --git a/doc/tensor.md b/doc/tensor.md
index d18af99..75eaebc 100644
--- a/doc/tensor.md
+++ b/doc/tensor.md
@@ -2122,7 +2122,7 @@ for i=1,7 do x[i] = i end
These functions apply a function to each element of the tensor on which called the
method (self). These methods are much faster than using a `for`
-loop in `Lua`. The results is stored in `self` (if the function returns
+loop in `Lua`. The results are stored in `self` (if the function returns
something).
<a name="torch.Tensor.apply"></a>
diff --git a/doc/tester.md b/doc/tester.md
index eab061a..da11b32 100644
--- a/doc/tester.md
+++ b/doc/tester.md
@@ -89,7 +89,7 @@ Returns a new instance of `torch.Tester` class.
<a name="torch.Tester.add"></a>
### add(f, 'name') ###
-Add `f`, either a test function or a table of test functions, to the tester.
+Adds `f`, either a test function or a table of test functions, to the tester.
If `f` is a function then names should be unique. There are a couple of special
values for `name`: if it is `_setUp` or `_tearDown`, then the function will be
@@ -105,7 +105,7 @@ Returns the torch.Tester instance.
<a name="torch.Tester.run"></a>
### run(testNames) ###
-Run tests that have been added by [add(f, 'name')](#torch.Tester.add).
+Runs tests that have been added by [add(f, 'name')](#torch.Tester.add).
While running it reports progress, and at the end gives a summary of all errors.
If a list of names `testNames` is passed, then all tests matching these names
@@ -120,7 +120,7 @@ tester:run({"test2", "test3"}) -- runs the tests named "test2" and "test3"
<a name="torch.Tester.disable"></a>
### disable(testNames) ###
-Prevent the given tests from running, where `testNames` can be a single string
+Prevents the given tests from running, where `testNames` can be a single string
or list of strings. More precisely, when [run](#torch.Tester.run)
is invoked, it will skip these tests, while still printing out an indication of
skipped tests. This is useful for temporarily disabling tests without
@@ -149,7 +149,7 @@ Completed 0 asserts in 1 test with 0 failures and 0 errors and 1 disabled
<a name="torch.Tester.assert"></a>
### assert(condition [, message]) ###
-Check that `condition` is true (using the optional `message` if the test
+Checks that `condition` is true (using the optional `message` if the test
fails).
Returns whether the test passed.
@@ -159,7 +159,7 @@ Returns whether the test passed.
General equality check between numbers, tables, strings, `torch.Tensor`
objects, `torch.Storage` objects, etc.
-Check that `got` and `expected` have the same contents, where tables are
+Checks that `got` and `expected` have the same contents, where tables are
compared recursively, tensors and storages are compared elementwise, and numbers
are compared within `tolerance` (default value `0`). Other types are compared by
strict equality. The optional `message` is used if the test fails.
@@ -177,7 +177,7 @@ Convenience function; does the same as
General inequality check between numbers, tables, strings, `torch.Tensor`
objects, `torch.Storage` objects, etc.
-Check that `got` and `unexpected` have different contents, where tables are
+Checks that `got` and `unexpected` have different contents, where tables are
compared recursively, tensors and storages are compared elementwise, and numbers
are compared within `tolerance` (default value `0`). Other types are compared by
strict equality. The optional `message` is used if the test fails.
@@ -192,35 +192,35 @@ Convenience function; does the same as
<a name="torch.Tester.assertlt"></a>
### assertlt(a, b [, message]) ###
-Check that `a < b` (using the optional `message` if the test fails),
+Checks that `a < b` (using the optional `message` if the test fails),
where `a` and `b` are numbers.
Returns whether the test passed.
<a name="torch.Tester.assertgt"></a>
### assertgt(a, b [, message]) ###
-Check that `a > b` (using the optional `message` if the test fails),
+Checks that `a > b` (using the optional `message` if the test fails),
where `a` and `b` are numbers.
Returns whether the test passed.
<a name="torch.Tester.assertle"></a>
### assertle(a, b [, message]) ###
-Check that `a <= b` (using the optional `message` if the test fails),
+Checks that `a <= b` (using the optional `message` if the test fails),
where `a` and `b` are numbers.
Returns whether the test passed.
<a name="torch.Tester.assertge"></a>
### assertge(a, b [, message]) ###
-Check that `a >= b` (using the optional `message` if the test fails),
+Checks that `a >= b` (using the optional `message` if the test fails),
where `a` and `b` are numbers.
Returns whether the test passed.
<a name="torch.Tester.asserteq"></a>
### asserteq(a, b [, message]) ###
-Check that `a == b` (using the optional `message` if the test fails).
+Checks that `a == b` (using the optional `message` if the test fails).
Note that this uses the generic lua equality check, so objects such as tensors
that have the same content but are distinct objects will fail this test;
consider using [assertGeneralEq()](#torch.Tester.assertGeneralEq) instead.
@@ -229,7 +229,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertne"></a>
### assertne(a, b [, message]) ###
-Check that `a ~= b` (using the optional `message` if the test fails).
+Checks that `a ~= b` (using the optional `message` if the test fails).
Note that this uses the generic lua inequality check, so objects such as tensors
that have the same content but are distinct objects will pass this test;
consider using [assertGeneralNe()](#torch.Tester.assertGeneralNe) instead.
@@ -238,7 +238,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertalmosteq"></a>
### assertalmosteq(a, b [, tolerance] [, message]) ###
-Check that `|a - b| <= tolerance` (using the optional `message` if the
+Checks that `|a - b| <= tolerance` (using the optional `message` if the
test fails), where `a` and `b` are numbers, and `tolerance` is an optional
number (default `1e-16`).
Returns whether the test passed.
@@ -246,7 +246,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertTensorEq"></a>
### assertTensorEq(ta, tb [, tolerance] [, message]) ###
-Check that `max(abs(ta - tb)) <= tolerance` (using the optional `message`
+Checks that `max(abs(ta - tb)) <= tolerance` (using the optional `message`
if the test fails), where `ta` and `tb` are tensors, and `tolerance` is an
optional number (default `1e-16`). Tensors that are different types or sizes
will cause this check to fail.
@@ -255,7 +255,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertTensorNe"></a>
### assertTensorNe(ta, tb [, tolerance] [, message]) ###
-Check that `max(abs(ta - tb)) > tolerance` (using the optional `message`
+Checks that `max(abs(ta - tb)) > tolerance` (using the optional `message`
if the test fails), where `ta` and `tb` are tensors, and `tolerance` is an
optional number (default `1e-16`). Tensors that are different types or sizes
will cause this check to pass.
@@ -264,7 +264,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertTableEq"></a>
### assertTableEq(ta, tb [, tolerance] [, message]) ###
-Check that the two tables have the same contents, comparing them
+Checks that the two tables have the same contents, comparing them
recursively, where objects such as tensors are compared using their contents.
Numbers (such as those appearing in tensors) are considered equal if
their difference is at most the given tolerance.
@@ -272,7 +272,7 @@ their difference is at most the given tolerance.
<a name="torch.Tester.assertTableNe"></a>
### assertTableNe(ta, tb [, tolerance] [, message]) ###
-Check that the two tables have distinct contents, comparing them
+Checks that the two tables have distinct contents, comparing them
recursively, where objects such as tensors are compared using their contents.
Numbers (such as those appearing in tensors) are considered equal if
their difference is at most the given tolerance.
@@ -280,7 +280,7 @@ their difference is at most the given tolerance.
<a name="torch.Tester.assertError"></a>
### assertError(f [, message]) ###
-Check that calling `f()` (via `pcall`) raises an error (using the
+Checks that calling `f()` (via `pcall`) raises an error (using the
optional `message` if the test fails).
Returns whether the test passed.
@@ -294,14 +294,14 @@ Returns whether the test passed.
<a name="torch.Tester.assertErrorMsg"></a>
### assertErrorMsg(f, errmsg [, message]) ###
-Check that calling `f()` (via `pcall`) raises an error with the specific error
+Checks that calling `f()` (via `pcall`) raises an error with the specific error
message `errmsg` (using the optional `message` if the test fails).
Returns whether the test passed.
<a name="torch.Tester.assertErrorPattern"></a>
### assertErrorPattern(f, errPattern [, message]) ###
-Check that calling `f()` (via `pcall`) raises an error matching `errPattern`
+Checks that calling `f()` (via `pcall`) raises an error matching `errPattern`
(using the optional `message` if the test fails).
The matching is done using `string.find`; in particular substrings will match.
Returns whether the test passed.
@@ -309,7 +309,7 @@ Returns whether the test passed.
<a name="torch.Tester.assertErrorObj"></a>
### assertErrorObj(f, errcomp [, message]) ###
-Check that calling `f()` (via `pcall`) raises an error object `err` such that
+Checks that calling `f()` (via `pcall`) raises an error object `err` such that
calling `errcomp(err)` returns true (using the optional `message` if the test
fails).
Returns whether the test passed.
diff --git a/doc/timer.md b/doc/timer.md
index aa6aba2..1274dd7 100644
--- a/doc/timer.md
+++ b/doc/timer.md
@@ -22,19 +22,19 @@ Returns a new `Timer`. The timer starts to count the time now.
<a name="torch.Timer.reset"></a>
### [self] reset() ###
-Reset the timer accumulated time to `0`. If the timer was running, the timer
+Resets the timer accumulated time to `0`. If the timer was running, the timer
restarts to count the time now. If the timer was stopped, it stays stopped.
<a name="torch.Timer.resume"></a>
### [self] resume() ###
-Resume a stopped timer. The timer restarts to count the time, and addition
+Resumes a stopped timer. The timer restarts to count the time, and addition
the accumulated time with the time already counted before being stopped.
<a name="torch.Timer.stop"></a>
### [self] stop() ###
-Stop the timer. The accumulated time counted until now is stored.
+Stops the timer. The accumulated time counted until now is stored.
<a name="torch.Timer.time"></a>
### [table] time() ###