Fix: TensorTanhNormal and TensorIndependent
Key Fixes and Improvements
TensorIndependentShape Bug: A bug wherereinterpreted_batch_ndims=0resulted in an incorrect shape has been fixed. The shape calculation now correctly returns the full shape of the base distribution in this case.TensorTanhNormalSimplification: Thereinterpreted_batch_ndimsparameter has been removed fromTensorTanhNormalto enforce a clearer separation of concerns. To achieve this functionality, users should now wrapTensorTanhNormalwithTensorIndependent. The class also now includes new statistical properties like mean, variance, and standard deviation.SamplingDistributionEnhancements: This class has been rewritten for better performance and reliability. It now uses__slots__for memory efficiency, includes better caching for statistical properties, improves error handling, and adds input validation.
Impact and Migration
This update introduces a breaking change: the reinterpreted_batch_ndims parameter is no longer available in TensorTanhNormal.