8000 DOC: Fixed minor typos in temp_elide.c · numpy/numpy@fe652b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe652b6

Browse files
committed
DOC: Fixed minor typos in temp_elide.c
[ci skip]
1 parent 2dd9125 commit fe652b6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

numpy/core/src/multiarray/temp_elide.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/*
1212
* Functions used to try to avoid/elide temporaries in python expressions
13-
* of type a + b + b by translating some operations into inplace operations.
13+
* of type a + b + b by translating some operations into in-place operations.
1414
* This example translates to this bytecode:
1515
*
1616
* 0 LOAD_FAST 0 (a)
@@ -23,7 +23,7 @@
2323
* instructions so they always have a reference count larger than 1.
2424
* The temporary of the first BINARY_ADD on the other hand only has a count of
2525
* 1. Only temporaries can have a count of 1 in python so we can use this to
26-
* transform the second operation into an inplace operation and not affect the
26+
* transform the second operation into an in-place operation and not affect the
2727
* output of the program.
2828
* CPython does the same thing to resize memory instead of copying when doing
2929
* string concatenation.
@@ -41,19 +41,19 @@
4141
* This is an expensive operation so temporaries are only avoided for rather
4242
* large arrays.
4343
*
44-
* A possible future improvement would be to change cpython to give as access
44+
* A possible future improvement would be to change cpython to give us access
4545
* to the top of the stack. Then we could just check that the objects involved
4646
* are on the cpython stack instead of checking the function callstack.
4747
*
48-
* Elision can be applied to all operations that do have inplace variants and
48+
* Elision can be applied to all operations that do have in-place variants and
4949
* do not change types (addition, subtraction, multiplication, float division,
5050
* logical and bitwise operations ...)
5151
* For commutative operations (addition, multiplication, ...) if eliding into
52-
* the lefthand side fails it can succedd on the righthand side by swapping the
52+
* the lefthand side fails it can succeed on the righthand side by swapping the
5353
* arguments. E.g. b * (a * 2) can be elided by changing it to (2 * a) * b.
5454
*
55-
* TODO only supports systems with backtrace(), windows can probably be
56-
* supported too by using the appropriate windows apis.
55+
* TODO only supports systems with backtrace(), Windows can probably be
56+
* supported too by using the appropriate Windows APIs.
5757
*/
5858

5959
#if defined HAVE_BACKTRACE && defined HAVE_DLFCN_H && ! defined PYPY_VERSION
@@ -69,7 +69,7 @@
6969
#endif
7070
/*
7171
* Heuristic size of the array in bytes at which backtrace overhead generation
72-
* becomes less than speed gained by inplace operations. Depends on stack depth
72+
* becomes less than speed gained by in-place operations. Depends on stack depth
7373
* being checked. Measurements with 10 stacks show it getting worthwhile
7474
* around 100KiB but to be conservative put it higher around where the L2 cache
7575
* spills.
@@ -79,7 +79,7 @@
7979
#else
8080
/*
8181
* in debug mode always elide but skip scalars as these can convert to 0d array
82-
* during in place operations
82+
* during in-place operations
8383
*/
8484
#define NPY_MIN_ELIDE_BYTES (32)
8585
#endif
@@ -272,7 +272,7 @@ check_callers(int * cannot)
272272

273273
/*
274274
* check if in "alhs @op@ orhs" that alhs is a temporary (refcnt == 1) so we
275-
* can do inplace operations instead of creating a new temporary
275+
* can do in-place operations instead of creating a new temporary
276276
* "cannot" is set to true if it cannot be done even with swapped arguments
277277
*/
278278
static int

0 commit comments

Comments
 (0)
0