@@ -300,7 +300,7 @@ def assemble(self):
300300
301301 def evaluate (self ):
302302 """
303- Compile, assemble and compute as needed.
303+ Compile, assemble, and compute as needed.
304304 """
305305 self ._tensor .evaluate ()
306306
@@ -431,19 +431,20 @@ def copy(self):
431431
432432 def insert (self , coords , val ):
433433 """
434- Increments the value at a given coordinate (:func:`insert`) .
434+ Increments the value at a given set of coordinates .
435435
436436 Parameters
437437 -----------
438438 coords: iter of ints
439- The coordinate of the tensor we want to assign to val
439+ The coordinates of the tensor element we want to assign to.
440440
441441 val: dtype
442- The value to assign to the given coordinate
442+ The value to assign the specified element to.
443443
444444 Warnings
445445 ----------
446- This function INCREMENTS the current value at coords.
446+ This function does *not* overwrite the element at the specified
447+ coordinates if it is already non-zero.
447448
448449 Examples
449450 ----------
@@ -581,38 +582,38 @@ def from_sp_csc(matrix, copy=True):
581582
582583def from_array (array , copy = True ):
583584
584- """Convert a numpy array to a tensor.
585+ """Convert a NumPy array to a tensor.
585586
586- Initializes a taco tensor from a numpy array and copies the array by default. This always creates a dense
587+ Initializes a taco tensor from a NumPy array and copies the array by default. This always creates a dense
587588 tensor.
588589
589590 Parameters
590591 ------------
591592 array: numpy.array
592- A numpy array to convert to a taco tensor
593+ A NumPy array to convert to a taco tensor
593594
594595 copy: boolean, optional
595- If true, taco copies the data from numpy and stores its own copy. If false, taco points to the same
596- underlying data as the numpy array.
596+ If true, taco copies the data from NumPy and stores its own copy. If false, taco points to the same
597+ underlying data as the NumPy array.
597598
598599 Warnings
599600 ---------
600- Taco's changes to tensors may NOT be visible to numpy since taco places inserts in buffers may copy tensor data
601+ Taco's changes to tensors may NOT be visible to NumPy since taco places inserts in buffers may copy tensor data
601602 after inserting. See notes for details.
602603
603604 Notes
604605 --------
605606 The copy flag is ignored if the input array is not C contiguous or F contiguous (so for most transposed views).
606- If taco detects an array that is not contiguous, it will always copy the numpy array into a C contiguous format.
607- Additionally, if the GPU backend is enabled, taco will always copy the numpy array to CUDA unified memory.
607+ If taco detects an array that is not contiguous, it will always copy the NumPy array into a C contiguous format.
608+ Additionally, if the GPU backend is enabled, taco will always copy the NumPy array to CUDA unified memory.
608609 These restriction will be lifted in future versions of taco.
609610
610611 Taco is mainly intended to operate on sparse tensors. As a result, it buffers inserts since inserting into sparse
611612 structures is very costly. This means that when the full tensor structure is needed, taco will copy the tensor to
612613 another location and insert the new values as needed. This saves a lot of time when dealing with sparse structures
613- but is not needed for dense tensors (like numpy arrays). Currently, taco does this copy for dense and sparse tensors.
614- As a result, after inserting into a taco tensor numpy will not see the changes since taco will not be writing to
615- the same memory location that numpy is referencing.
614+ but is not needed for dense tensors (like NumPy arrays). Currently, taco does this copy for dense and sparse tensors.
615+ As a result, after inserting into a taco tensor, NumPy will not see the changes since taco will not be writing to
616+ the same memory location that NumPy is referencing.
616617
617618
618619 See also
@@ -621,7 +622,7 @@ def from_array(array, copy=True):
621622
622623 Examples
623624 ----------
624- If we choose not to copy, modifying the tensor also modifies the numpy array and vice-versa. An example of this is
625+ If we choose not to copy, modifying the tensor also modifies the NumPy array and vice-versa. An example of this is
625626 shown:
626627
627628 .. doctest::
@@ -639,8 +640,8 @@ def from_array(array, copy=True):
639640 Returns
640641 --------
641642 t: tensor
642- A taco tensor pointing to the same underlying data as the numpy array if copy was set to False. Otherwise,
643- returns a taco tensor containing data copied from the numpy array.
643+ A taco tensor pointing to the same underlying data as the NumPy array if copy was set to False. Otherwise,
644+ returns a taco tensor containing data copied from the NumPy array.
644645 """
645646
646647
@@ -657,23 +658,23 @@ def from_array(array, copy=True):
657658
658659def to_array (t ):
659660 """
660- Converts a taco tensor to a numpy array.
661+ Converts a taco tensor to a NumPy array.
661662
662663 This always copies the tensor. To avoid the copy for dense tensors, see the notes section.
663664
664665 Parameters
665666 -----------
666667 t: tensor
667- A taco tensor to convert to a numpy array.
668+ A taco tensor to convert to a NumPy array.
668669
669670 Notes
670671 -------
671- Dense tensors export python's buffer interface. As a result, they can be converted to numpy arrays using
672+ Dense tensors export python's buffer interface. As a result, they can be converted to NumPy arrays using
672673 ``np.array(tensor, copy=False)`` . Attempting to do this for sparse tensors throws an error. Note that as a result
673674 of exporting the buffer interface dense tensors can also be converted to eigen or any other library supporting this
674675 inferface.
675676
676- Also it is very important to note that if requesting a numpy view of data owned by taco, taco will mark the array as
677+ Also it is very important to note that if requesting a NumPy view of data owned by taco, taco will mark the array as
677678 read only meaning the user cannot write to that data without using the taco reference. This is needed to avoid
678679 raising issues with taco's delayed execution mechanism.
679680
@@ -707,7 +708,7 @@ def to_array(t):
707708 Returns
708709 ---------
709710 arr: numpy.array
710- A numpy array containing a copy of the data in the tensor object t.
711+ A NumPy array containing a copy of the data in the tensor object t.
711712
712713 """
713714 return np .array (t .to_dense (), copy = True )
@@ -820,7 +821,7 @@ def as_tensor(obj, copy=True):
820821 if isinstance (obj , csr_matrix ):
821822 return from_sp_csr (obj , copy )
822823
823- # Try converting object to numpy array. This will ignore the copy flag
824+ # Try converting object to NumPy array. This will ignore the copy flag
824825 arr = np .array (obj )
825826 return from_array (arr , True )
826827
@@ -2401,7 +2402,7 @@ def matmul(t1, t2, out_format=default_mode, dtype=None):
24012402
24022403 Examples
24032404 ---------
2404- Here we demonstrate broadcasting for a 3-D tensor. We use numpy arrays for demonstration due to easy data
2405+ Here we demonstrate broadcasting for a 3-D tensor. We use NumPy arrays for demonstration due to easy data
24052406 generation. However, we could have given sparse tensors of any format for taco to compute. Note that the
24062407 choice of a tensor format has a big effect on the final performance. For instance it is favorable to multiply
24072408 CSR matrices with CSC since dot products can be easily computed.
@@ -2521,7 +2522,7 @@ def dot(t1, t2, out_format=default_mode, dtype=None):
25212522 """
25222523 The dot product of two tensors.
25232524
2524- This implements the same spec as numpy but allows for sparse taco tensors as operands.
2525+ This implements the same spec as NumPy but allows for sparse taco tensors as operands.
25252526
25262527 * If both t1 and t2 are 1-D then this is an inner product.
25272528
@@ -2860,7 +2861,7 @@ def evaluate(expr, *operands, out_format=None, dtype=None):
28602861 the elements of a matrix while the corresponding string would be ``A = B(i, j)``.
28612862
28622863
2863- The string parser currently only supports +, -, / and *. Thus, expressions involving other functions such as exp,
2864+ The string parser currently only supports +, -, /, and \ *. Thus, expressions involving other functions such as exp,
28642865 tan etc, would have to be written using the pythonic expressions.
28652866
28662867 An input tensor is recognised by the parser by a name followed by a comma separated list of index variables in
@@ -2953,7 +2954,7 @@ def einsum(expr, *operands, out_format=None, dtype=None):
29532954 """
29542955 Evaluates the Einstein summation convention on the input operands.
29552956
2956- The einsum summation convention employed here is very similar to `numpy 's
2957+ The einsum summation convention employed here is very similar to `NumPy 's
29572958 <https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html#numpy.einsum>`_ but has some differences
29582959 explained below.
29592960
@@ -2968,7 +2969,7 @@ def einsum(expr, *operands, out_format=None, dtype=None):
29682969
29692970 Warnings
29702971 ----------
2971- This differs from numpy 's einsum in two important ways. The first is that the same subscript cannot appear more than
2972+ This differs from NumPy 's einsum in two important ways. The first is that the same subscript cannot appear more than
29722973 once in a given operand. The second is that for sparse tensors, some expressions may require the user to explicitly
29732974 transpose the tensors before passing them into einsum.
29742975
@@ -2980,7 +2981,7 @@ def einsum(expr, *operands, out_format=None, dtype=None):
29802981 subscript labels specifying the output.
29812982
29822983 operands: list of array_like, tensors, scipy csr and scipy csc matrices
2983- This specifies the operands for the computation. Taco will copy any numpy arrays that are not stored in
2984+ This specifies the operands for the computation. Taco will copy any NumPy arrays that are not stored in
29842985 row-major or column-major format.
29852986
29862987 out_format: format, optional
@@ -3060,7 +3061,7 @@ def einsum(expr, *operands, out_format=None, dtype=None):
30603061 >>> pt.tensor_sum(t)[0]
30613062 60.0
30623063
3063- The `numpy docs <https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html#numpy.einsum>`_ contain
3064+ The `NumPy docs <https://docs.scipy.org/doc/numpy/reference/generated/numpy.einsum.html#numpy.einsum>`_ contain
30643065 more examples and an in depth explanation of this notation can be found
30653066 `here <https://rockt.github.io/2018/04/30/einsum>`_.
30663067
@@ -3083,7 +3084,7 @@ def einsum(expr, *operands, out_format=None, dtype=None):
30833084
30843085def apply (func_name , arg_list , output_zero_specifier ):
30853086 """
3086- Applies a user defined function to an :class:`index_expression`.
3087+ Applies a user- defined function to an :class:`index_expression`.
30873088
30883089 Parameters
30893090 ------------
@@ -3116,11 +3117,11 @@ def apply(func_name, arg_list, output_zero_specifier):
31163117
31173118def set_udf_dir (dir_to_search ):
31183119 """
3119- Sets the directory to search for user defined functions.
3120+ Sets the directory to search for user- defined functions.
31203121
31213122 Parameters
31223123 ------------
31233124 dir_to_search: str
3124- The directory that taco should search when looking for user defined functions.
3125+ The directory that taco should search when looking for user- defined functions.
31253126 """
31263127 raise NotImplementedError
0 commit comments