<commit_before>#include "../test_tensor.hpp"
#include "nnlib/core/tensor.hpp"
using namespace nnlib;

void TestTensor()
{
	// test empty concat

	{
		Tensor<NN_REAL_T> empty = Tensor<NN_REAL_T>::concatenate({});
		NNAssertEquals(empty.size(), 0, "Tensor::concatenate on an empty list failed!");
	}

	// test random permutation

	{
		Tensor<size_t> perm = Tensor<size_t>::randPermutation(3);
		bool hasZero = false, hasOne = false, hasTwo = false;
		for(size_t i = 0; i < 3; ++i)
		{
			if(perm(i) == 0)
				hasZero = true;
			else if(perm(i) == 1)
				hasOne = true;
			else if(perm(i) == 2)
				hasTwo = true;
		}
		NNAssert(hasZero && hasOne && hasTwo, "Tensor::randPermutation failed!");
	}

	// test resizing to the same size

	{
		Tensor<NN_REAL_T> t(3);
		t.resizeDim(0, 3);
		NNAssertEquals(t.size(0), 3, "Tensor::resizeDim to the same size failed!");
	}

	// test constructors

	Tensor<NN_REAL_T> empty;
	NNAssertEquals(empty.size(), 0, "Tensor::Tensor() failed!");<commit_msg>Removed randPermutation from Tensor; made Tensor only work for NN_REAL_T unless header-only.<commit_after>#include "../test_tensor.hpp"
#include "nnlib/core/tensor.hpp"
using namespace nnlib;

void TestTensor()
{
	// test empty concat

	{
		Tensor<NN_REAL_T> empty = Tensor<NN_REAL_T>::concatenate({});
		NNAssertEquals(empty.size(), 0, "Tensor::concatenate on an empty list failed!");
	}

	// test resizing to the same size

	{
		Tensor<NN_REAL_T> t(3);
		t.resizeDim(0, 3);
		NNAssertEquals(t.size(0), 3, "Tensor::resizeDim to the same size failed!");
	}

	// test constructors

	Tensor<NN_REAL_T> empty;
	NNAssertEquals(empty.size(), 0, "Tensor::Tensor() failed!");
{'fraction_non_alphanumeric': 0.15849969751966123, 'fraction_numerical': 0.012099213551119177, 'mean_word_length': 4.352750809061488, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 13, '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': '2248403', 'n_tokens_mistral': 665, 'n_tokens_neox': 616, 'n_words': 146}