Skip to content

Commit

Permalink
Overall improve formatting, add doc message corrections
Browse files Browse the repository at this point in the history
simplify construction

clang-format

more tests

undo simpler construction due to function passing stuff

fix docs

more exclusive doc changes

more fixins"
  • Loading branch information
Andrew Zhao Luo authored and Andrew Zhao Luo committed Mar 24, 2021
1 parent 6bb3eb2 commit 4ead969
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions python/tvm/relay/op/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,9 +1536,9 @@ def cumsum(data, axis=None, dtype=None, exclusive=None):
Type of the returned array and of the accumulator in which the elements are summed.
If dtype is not specified, it defaults to the dtype of data.
exclusive : int, optional
If set to 1 will return exclusive sum in which the first element is not
included. In other terms, if set to 1, the j-th output element would be
exclusive : bool, optional
If true will return exclusive sum in which the first element is not
included. In other terms, if true, the j-th output element would be
the sum of the first (j-1) elements. Otherwise, it would be the sum of
the first j elements.
Expand Down Expand Up @@ -1591,9 +1591,9 @@ def cumprod(data, axis=None, dtype=None, exclusive=None):
Type of the returned array and of the accumulator in which the elements are multiplied.
If dtype is not specified, it defaults to the dtype of data.
exclusive : int, optional
If set to 1 will return exclusive product in which the first element is not
included. In other terms, if set to 1, the j-th output element would be
exclusive : bool, optional
If true will return exclusive product in which the first element is not
included. In other terms, if true, the j-th output element would be
the product of the first (j-1) elements. Otherwise, it would be the product of
the first j elements. The product of zero elements will be 1.
Expand Down
12 changes: 6 additions & 6 deletions python/tvm/topi/cuda/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ def cumbinop(
Type of the returned array and of the accumulator in which the elements are computed.
If dtype is not specified, it defaults to the dtype of data.
exclusive : int, optional
If set to 1 will return exclusive cumulative operation in which the first element is not
included. In other terms, if set to 1, the j-th output element would be
exclusive : bool, optional
If true will return exclusive cumulative operation in which the first element is not
included. In other terms, if true, the j-th output element would be
the cumulative operation of the first (j-1) elements. Otherwise, it would be the
cumulative operation of the first j elements.
Expand Down Expand Up @@ -604,9 +604,9 @@ def cumsum(
Type of the returned array and of the accumulator in which the elements are summed.
If dtype is not specified, it defaults to the dtype of data.
exclusive : int, optional
If set to 1 will return exclusive sum in which the first element is not
included. In other terms, if set to 1, the j-th output element would be
exclusive : bool, optional
If true will return exclusive sum in which the first element is not
included. In other terms, if true, the j-th output element would be
the sum of the first (j-1) elements. Otherwise, it would be the sum of
the first j elements.
Expand Down
6 changes: 3 additions & 3 deletions python/tvm/topi/cumsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def cumbinop(
Type of the returned array and of the accumulator in which the elements are computed.
If dtype is not specified, it defaults to the dtype of data.
exclusive : int, optional
If set to 1 will return exclusive cumulative operation in which the first element is not
included. In other terms, if set to 1, the j-th output element would be
exclusive : bool, optional
If True will return exclusive cumulative operation in which the first element is not
included. In other terms, if True, the j-th output element would be
the cumulative operation of the first (j-1) elements. Otherwise, it would be the
cumulative operation of the first j elements. The cumulative operation of zero elements
is assumed to be the identity_value.
Expand Down
2 changes: 1 addition & 1 deletion tests/python/relay/test_op_level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@ def assert_relay_cumbinop(
assert_relay_cumbinop(data, gt_func(data, dtype="int64"), out_dtype="int64")

# Test exclusivity operations
data = np.random.randint(-100, 100, size=(2, 2)).astype("int64")
data = np.random.randint(-100, 100, size=(10, 10)).astype("int64")
expected_result = np.roll(gt_func(data), 1)
expected_result[0] = identity_value
assert_relay_cumbinop(data, expected_result, exclusive=True)
Expand Down

0 comments on commit 4ead969

Please sign in to comment.