Getting rid of Dtype templating

23 vistas
Ir al primer mensaje no leído

Martin Devera

no leída,
13 feb 2017, 3:47:09 p.m.13/2/2017
para Caffe Users
Hi,

the Dtype is specialized in caffe.cpp and _caffe.cpp as float. Thus there seems no
real need to have it as template parameter.
We could define Dtype using typedef which allows to remove almost all templates.

While I have no problems with metaprograming, it seems unnecessary here and
is cluttering both code and gcc error messages.

Is there any reason to not do it ? 

regards, Martin

Alexandre Vieira

no leída,
14 feb 2017, 5:24:31 a.m.14/2/2017
para Caffe Users
I've seen this <Dtype> template thing all around the code. Does this mean I can change the default data-type that Caffe uses? If so, which data structures would be affected? Just weights, or also all the gradient back-propagation data-type would be changed?

Thanks,
Regards,
Alexandre

Martin Devera

no leída,
14 feb 2017, 11:04:49 a.m.14/2/2017
para Caffe Users
Yes you can. Mainly it changes Blobs and then all other places needed to accomodate
the change.
Templating allows you one extra thing over typedef, you can instantiate Net/Solver
for both double and float in the same code.
But IMHO it is not worth its complexity....

Dne úterý 14. února 2017 11:24:31 UTC+1 Alexandre Vieira napsal(a):

Michele Pratusevich

no leída,
15 feb 2017, 11:21:45 p.m.15/2/2017
para Caffe Users
It allows you to change between using doubles and floats as your weights and inputs - I wouldn't call it "completely unnecessary".
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos