Removed identity function because ist is incorrect.

This commit is contained in:
2023-02-24 21:04:26 +01:00
parent be2db961a9
commit 3cb2f272eb
2 changed files with 0 additions and 20 deletions

View File

@@ -139,25 +139,6 @@ int tensor_init_rand(tensor t, int dimension, const int *size, int max)
return 1;
}
int tensor_init_identity(tensor t, int dimension, int size)
{
int i ,j;
int *indx = malloc(sizeof(int) * dimension);
for(i = 0; i < dimension; i++) indx[i] = size;
if(!tensor_init_zero(t, dimension, indx)) {
free(indx);
return 0;
}
for(j = 0; j < size; j++) {
for(i = 0; i < dimension; i++) indx[i] = j;
tensor_set(t, indx, 1);
}
free(indx);
return 1;
}
void tensor_for_each_elem(tensor t, dtype (*func)(dtype))
{
int i;