After experimenting a bit my problem was thinking that arguments are copied instead of passed by reference. The problem is that
x=x+1

Is creating a new variable while
x.data=x+1

is accessing a method. Taking in account that arguments are passed by reference instead  of copied in a function call yield my error. In fact the key error is not coding this like:
def normalize(x_):
	min_val_aux,ind=torch.min(x_.data,1)   
	max_val_aux,ind=torch.max(x_.data,1)
	min_val = torch.zeros(100,1).cuda()
	max_val = torch.zeros(100,1).cuda()                                                     
	min_val[:,0]=min_val_aux                                                          
	max_val[:,0]=max_val_aux 
	a,b=x_.shape
	min_val=min_val.expand(100,b)
	max_val=max_val.expand(100,b)
	
	x_=(x_.data-min_val)/(max_val-min_val)# change x_.data= to x=
	return x_.cpu()

Entirely my mistake.  Normally when I code in python I forget about memory management. I only activate that part of my brain when coding C or C++. An that, in addition to the fact that in previous versions of pytorch combining computation of Variables and tensor (for example gaussian noise addition) was reduced to accessing .data lots of times I did not take the problem presented when coding this function.
Thanks @albanD for your time.