Skip to content

Conversation

@ssam18
Copy link

@ssam18 ssam18 commented Dec 18, 2025

Summary

Fix segmentation fault in NormalizeComponentsUnitInterval::train() when using non-default template types.

Problem

When the NormalizeComponentsUnitInterval template is instantiated with a vector type other than RealVector (e.g., remora::vector<double, remora::cpu_tag>), the train() method crashes with a segmentation fault at:

RealVector min = input.element(0);
RealVector max = input.element(0);

The implicit conversion from the element proxy object to RealVector fails for non-default types.

Solution

Change RealVector to DataType for the min and max variables, ensuring the correct type is used based on the template parameter.

Fixes #285

Change RealVector to DataType for min/max variables in train() method.
When the template is instantiated with a different vector type (e.g.,
remora::vector<double, remora::cpu_tag>), the implicit conversion from
the element proxy to RealVector fails, causing a segmentation fault.

Fixes Shark-ML#285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segmentation Fault in shark::NormalizeComponentsUnitInterval.h

1 participant