Skip to content

Commit

Permalink
Fixed bug that occurs when non-c-contiguous arrays are passed to the …
Browse files Browse the repository at this point in the history
…FastConv1d feature generator.
  • Loading branch information
jlparkI committed Oct 26, 2024
1 parent 71d64a0 commit 5d3c4cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xGPR/kernels/convolution_kernels/conv_feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def transform_x(self, input_x, sequence_length):

if self.device == "cpu":
output_x = np.zeros((input_x.shape[0], self.num_rffs), np.float64)
x_in = input_x.astype(np.float32, copy=False)
x_in = np.ascontiguousarray(input_x.astype(np.float32, copy=False))
cpuConv1dMaxpool(x_in, output_x, self.radem_diag, self.chi_arr,
sequence_length, self.conv_width, self.num_threads, self.simplex_rffs)
else:
output_x = cp.zeros((input_x.shape[0], self.num_rffs), cp.float64)
x_in = cp.asarray(input_x).astype(cp.float32, copy=False)
x_in = cp.ascontiguousarray(cp.asarray(input_x).astype(cp.float32, copy=False))
cudaConv1dMaxpool(x_in, output_x, self.radem_diag, self.chi_arr,
sequence_length, self.conv_width, self.simplex_rffs)

Expand Down

0 comments on commit 5d3c4cb

Please sign in to comment.