Skip to content

Commit

Permalink
refac: update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bassoy committed Oct 27, 2024
1 parent 90f3675 commit ed93df7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ High-Performance Tensor-Matrix Multiplication Library - TLIB(TTM)
[![Language](https://img.shields.io/badge/C%2B%2B-17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization)
[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://github.com/bassoy/ttm/blob/master/LICENSE)
[![Wiki](https://img.shields.io/badge/ttm-wiki-blue.svg)](https://github.com/bassoy/ttm/wiki)
[![Gitter](https://img.shields.io/badge/ttm-chat%20on%20gitter-4eb899.svg)](https://gitter.im/bassoy)
[![Discussions](https://img.shields.io/badge/ttm-discussions-blue.svg)](https://github.com/bassoy/ttm/discussions)
[![Build Status](https://github.com/bassoy/ttm/actions/workflows/test.yml/badge.svg)](https://github.com/bassoy/ttm/actions)

## Summary
Expand Down Expand Up @@ -37,8 +37,8 @@ Please have a look at the [wiki](https://github.com/bassoy/ttm/wiki) page for mo
* For large tensors reaches peak matrix-times-matrix performance

### Requirements
* Requires the tensor elements to be contiguously stored in memory.
* Element types must be either `float` or `double`.
* Requires the tensor elements to be contiguously stored in memory
* Element types must be either `float` or `double`

## Python Example
```python
Expand Down
10 changes: 5 additions & 5 deletions include/tlib/detail/layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ inline void compute_last_order_layout(OutputIt begin, OutputIt end)
template<class InputIt, class SizeType>
inline auto inverse_mode(InputIt layout_begin, InputIt layout_end, SizeType mode )
{
using value_type = typename std::iterator_traits<InputIt>::value_type;
using value_type = typename std::iterator_traits<InputIt>::value_type;
if(!is_valid_layout(layout_begin,layout_end))
throw std::runtime_error("Error in tlib::detail::inverse_mode(): input layout is not valid.");

Expand All @@ -130,13 +130,13 @@ inline auto inverse_mode(InputIt layout_begin, InputIt layout_end, SizeType mode

auto const p = static_cast<value_type>(p_);

if(mode==0u || mode > SizeType(p))
throw std::runtime_error("Error in tlib::detail::inverse_mode(): mode should be one-based and equal to or less than layout size.");
if(mode==0u || mode > SizeType(p))
throw std::runtime_error("Error in tlib::detail::inverse_mode(): mode should be one-based and equal to or less than layout size.");

auto inverse_mode = value_type{0u};
for(; inverse_mode < p; ++inverse_mode)
if(layout_begin[inverse_mode] == value_type(mode))
break;
if(layout_begin[inverse_mode] == value_type(mode))
break;

assert(inverse_mode < p);

Expand Down

0 comments on commit ed93df7

Please sign in to comment.