Check for broadcasting compatibility in Tensorflow - C++ API -


i implementing element-wise operations in tensorflow. many tensorflow operations, e.g. add, support broadcasting (from numpy). broadcasting possible if following rule respected:

when operating on 2 tensors, shapes should compared element-wise. procedure starts trailing dimensions, , works way forward. 2 dimensions compatible when equal, or 1 of them 1. if these conditions not met, exception thrown, indicating tensors have incompatible shapes. size of resulting tensor maximum size along each dimension of input arrays.

does tensorflow c++ api provide method comparing compatibility of 2 tensors? or, fastest way that?

all element-wise binary operations' kernel implementations in tensorflow derive binaryopshared class, compatibility checking via helper class binaryopstate. perhaps, can derive kernel class binaryopshared , compatibility checking free.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -