You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* PYTTB_UTILS: Finish adding types without refactor
* PYTTB_UTILS: Fix typing on tt_tenfun
* PYTTB_UTILS: Doc cleanup
* Remove unneeded method
* Update examples/docs most places
* Mark remaining improvements
* PYTTB_UTILS: Doc cleanup
* Update doc strings for remaining utils
* Make tt_tenfun a tensor method to more closely align to elemfun and MATLAB
* RUFF: Enable Pydocstyle
* Mostly adding periods, newlines, and imperitive phrasing
* RUFF: forgot to run format after doc updates
* Fix merge errors and capture stricter requirements on main.
* Fix type hint for more flexible tensor collapse.
* TTENSOR: Fix missing newline and indentation.
Copy file name to clipboardExpand all lines: docs/source/tutorial/class_tensor.ipynb
+6-7
Original file line number
Diff line number
Diff line change
@@ -27,8 +27,7 @@
27
27
"source": [
28
28
"import pyttb as ttb\n",
29
29
"import numpy as np\n",
30
-
"import sys\n",
31
-
"from pyttb.pyttb_utils import tt_tenfun"
30
+
"import sys"
32
31
]
33
32
},
34
33
{
@@ -847,8 +846,8 @@
847
846
"cell_type": "markdown",
848
847
"metadata": {},
849
848
"source": [
850
-
"## Using `tt_tenfun` for elementwise operations on one or more `tensor`s\n",
851
-
"The function `tt_tenfun` applies a specified function to a number of `tensor`s. This can be used for any function that is not predefined for `tensor`s."
849
+
"## Using `tenfun` for elementwise operations on one or more `tensor`s\n",
850
+
"The method `tenfun` applies a specified function to a number of `tensor`s. This can be used for any function that is not predefined for `tensor`s."
852
851
]
853
852
},
854
853
{
@@ -859,7 +858,7 @@
859
858
"source": [
860
859
"np.random.seed(0)\n",
861
860
"A = ttb.tensor(np.floor(3 * np.random.rand(2, 2, 3))) # Generate some data.\n",
862
-
"tt_tenfun(lambda x: x + 1, A) # Increment every element of A by one."
861
+
"A.tenfun(lambda x: x + 1) # Increment every element of A by one."
863
862
]
864
863
},
865
864
{
@@ -873,7 +872,7 @@
873
872
" return np.maximum(a, b)\n",
874
873
"\n",
875
874
"\n",
876
-
"tt_tenfun(max_elements, A, B) # Max of A and B, elementwise."
875
+
"A.tenfun(max_elements, B) # Max of A and B, elementwise."
877
876
]
878
877
},
879
878
{
@@ -891,7 +890,7 @@
891
890
" return np.floor(np.mean(X, axis=0))\n",
892
891
"\n",
893
892
"\n",
894
-
"tt_tenfun(elementwise_mean, A, B, C) # Elementwise means for A, B, and C."
893
+
"A.tenfun(elementwise_mean, B, C) # Elementwise means for A, B, and C."
0 commit comments