Skip to content

Commit

Permalink
remove explicit casts
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Oct 7, 2024
1 parent c03a36d commit ff9fb42
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions python/cudf/cudf/_lib/nvtext/generate_ngrams.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

from cudf.core.buffer import acquire_spill_lock

from pylibcudf.libcudf.types cimport size_type
from pylibcudf.scalar cimport Scalar as plc_Scalar

from cudf._lib.column cimport Column

from pylibcudf import nvtext
Expand All @@ -14,8 +11,8 @@ from pylibcudf import nvtext
def generate_ngrams(Column strings, int ngrams, object py_separator):
result = nvtext.generate_ngrams.generate_ngrams(
strings.to_pylibcudf(mode="read"),
<size_type> ngrams,
<plc_Scalar> py_separator.device_value.c_value
ngrams,
py_separator.device_value.c_value
)
return Column.from_pylibcudf(result)

Expand All @@ -24,7 +21,7 @@ def generate_ngrams(Column strings, int ngrams, object py_separator):
def generate_character_ngrams(Column strings, int ngrams):
result = nvtext.generate_ngrams.generate_character_ngrams(
strings.to_pylibcudf(mode="read"),
<size_type> ngrams
ngrams
)
return Column.from_pylibcudf(result)

Expand All @@ -33,6 +30,6 @@ def generate_character_ngrams(Column strings, int ngrams):
def hash_character_ngrams(Column strings, int ngrams):
result = nvtext.generate_ngrams.hash_character_ngrams(
strings.to_pylibcudf(mode="read"),
<size_type> ngrams
ngrams
)
return Column.from_pylibcudf(result)

0 comments on commit ff9fb42

Please sign in to comment.