<commit_before>import { NDArray } from './';

NDArray.transpose = <T extends NDArray>(x: T): T => x.copy().transpose();

NDArray.prototype.transpose = function<T extends NDArray>(this: T): T {
  const [r, c] = this.shape;
  const { data: d1 } = this;
  const x: T = this.copy().reshape(c, r);
  const { data: d2 } = x;

  let i: number;
  let j: number;
  for (i = 0; i < r; i += 1) {
    for (j = 0; j < c; j += 1) {
      d2[j * c + i] = d1[i * c + j];
    }
  }
<commit_msg>fix transpose typo<commit_after>import { NDArray } from './';

NDArray.transpose = <T extends NDArray>(x: T): T => x.copy().transpose();

NDArray.prototype.transpose = function<T extends NDArray>(this: T): T {
  const [r, c] = this.shape;
  const { data: d1 } = this;
  const x: T = this.copy().reshape(c, r);
  const { data: d2 } = x;

  let i: number;
  let j: number;
  for (i = 0; i < r; i += 1) {
    for (j = 0; j < c; j += 1) {
      d2[j * r + i] = d1[i * c + j];
    }
  }

{'fraction_non_alphanumeric': 0.20229405630865485, 'fraction_numerical': 0.016684045881126174, 'mean_word_length': 2.595505617977528, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1641272', 'n_tokens_mistral': 415, 'n_tokens_neox': 398, 'n_words': 120}