Skip to content

Commit 6e04e58

Browse files
committed
Change input data type to int64_t in unitest and GPU kernel
1 parent 77cf21e commit 6e04e58

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

paddle/operators/edit_distance_op.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ __global__ void FillFirstColumn(T* dist, const int M, const int N) {
3939
}
4040

4141
template <typename T>
42-
__global__ void Levenshtein(T* dist, const int* x1, const int* x2, const int M,
43-
const int N, const int start) {
42+
__global__ void Levenshtein(T* dist, const int64_t* x1, const int64_t* x2,
43+
const int M, const int N, const int start) {
4444
int idx = blockDim.x * blockIdx.x + threadIdx.x;
4545
int offset = N;
4646
int index = start + idx * offset;

python/paddle/v2/fluid/tests/test_edit_distance_op.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class TestEditDistanceOp(OpTest):
5151
def setUp(self):
5252
self.op_type = "edit_distance"
5353
normalized = False
54-
x1 = np.array([[0, 12, 3, 5, 8, 2]]).astype("int32")
55-
x2 = np.array([[0, 12, 4, 7, 8]]).astype("int32")
54+
x1 = np.array([[0, 12, 3, 5, 8, 2]]).astype("int64")
55+
x2 = np.array([[0, 12, 4, 7, 8]]).astype("int64")
5656
x1 = np.transpose(x1)
5757
x2 = np.transpose(x2)
5858
x1_lod = [0, 1, 5]
@@ -79,8 +79,8 @@ class TestEditDistanceOpNormalized(OpTest):
7979
def setUp(self):
8080
self.op_type = "edit_distance"
8181
normalized = True
82-
x1 = np.array([[0, 10, 3, 6, 5, 8, 2]]).astype("int32")
83-
x2 = np.array([[0, 10, 4, 6, 7, 8]]).astype("int32")
82+
x1 = np.array([[0, 10, 3, 6, 5, 8, 2]]).astype("int64")
83+
x2 = np.array([[0, 10, 4, 6, 7, 8]]).astype("int64")
8484
x1 = np.transpose(x1)
8585
x2 = np.transpose(x2)
8686
x1_lod = [0, 1, 3, 6]

0 commit comments

Comments
 (0)