| 227 | } |
| 228 | |
| 229 | int64 CalculateOutputSize( |
| 230 | const std::vector<OpInfo::TensorProperties>& output_properties, |
| 231 | const int port_num) { |
| 232 | if (port_num < 0) return 4; // 4B for control dependency. |
| 233 | |
| 234 | if (port_num >= output_properties.size()) { |
| 235 | LOG(ERROR) << "CalculateOutputSize() -- port_num: " << port_num |
| 236 | << " >= output_properties.size(): " << output_properties.size(); |
| 237 | return 0; |
| 238 | } |
| 239 | |
| 240 | return CalculateTensorSize(output_properties[port_num]); |
| 241 | } |
| 242 | |
| 243 | DeviceProperties GetDeviceInfo(const string& device_str) { |
| 244 | DeviceProperties unknown; |