@@ -964,47 +964,47 @@ def pivot(self, tensor: Tensor, pivot_axis: int = -1) -> Tensor:
964
964
def serialize_tensor (self , tensor : Tensor ) -> str :
965
965
"""
966
966
Return a string that serializes the given tensor.
967
-
967
+
968
968
Args:
969
969
tensor: The input tensor.
970
-
970
+
971
971
Returns:
972
- A string representing the serialized tensor.
972
+ A string representing the serialized tensor.
973
973
"""
974
974
raise NotImplementedError (
975
975
"Backend '{}' has not implemented serialize_tensor." .format (self .name ))
976
976
977
977
def deserialize_tensor (self , s : str ) -> Tensor :
978
978
"""
979
- Return a tensor given a serialized tensor string.
980
-
979
+ Return a tensor given a serialized tensor string.
980
+
981
981
Args:
982
982
s: The input string representing a serialized tensor.
983
-
983
+
984
984
Returns:
985
985
The tensor object represented by the string.
986
-
986
+
987
987
"""
988
988
raise NotImplementedError (
989
989
"Backend '{}' has not implemented deserialize_tensor." .format (
990
990
self .name ))
991
991
992
992
def power (self , a : Tensor , b : Union [Tensor , float ]) -> Tensor :
993
993
"""
994
- Returns the exponentiation of tensor a raised to b.
995
- If b is a tensor, then the exponentiation is element-wise
994
+ Returns the exponentiation of tensor a raised to b.
995
+ If b is a tensor, then the exponentiation is element-wise
996
996
between the two tensors, with a as the base and b as the power.
997
- Note that a and b must be broadcastable to the same shape if
997
+ Note that a and b must be broadcastable to the same shape if
998
998
b is a tensor.
999
999
If b is a scalar, then the exponentiation is each value in a
1000
1000
raised to the power of b.
1001
-
1001
+
1002
1002
Args:
1003
1003
a: The tensor containing the bases.
1004
1004
b: The tensor containing the powers; or a single scalar as the power.
1005
1005
1006
1006
Returns:
1007
- The tensor that is each element of a raised to the
1007
+ The tensor that is each element of a raised to the
1008
1008
power of b. Note that the shape of the returned tensor
1009
1009
is that produced by the broadcast of a and b.
1010
1010
"""
0 commit comments