def testConvTransposeFlopsCoeff(self): # Divide by the input depth and the output depth to get the coefficient. expected_coeff = _flops(self.convt_op) / (17.0 * 29.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.convt_op) self.assertNearRelatively(expected_coeff, actual_coeff)
def testDepthwiseConvFlopsCoeff(self): # Divide by the input depth (which is also the output depth) to get the # coefficient. expected_coeff = _flops(self.dw_op) / (10.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.dw_op) self.assertNearRelatively(expected_coeff, actual_coeff)
def testFcFlopsCoeff(self): expected_coeff = _flops(self.matmul_op) / (19.0 * 23.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.matmul_op) self.assertNearRelatively(expected_coeff, actual_coeff)
def testFcFlopsCoeff(self): expected_coeff = _flops(self.matmul_op) / (19.0 * 23.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.matmul_op) self.assertNearRelatively(expected_coeff, actual_coeff)
def testConvTransposeFlopsCoeff(self): # Divide by the input depth and the output depth to get the coefficient. expected_coeff = _flops(self.convt_op) / (17.0 * 29.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.convt_op) self.assertNearRelatively(expected_coeff, actual_coeff)
def testDepthwiseConvFlopsCoeff(self): # Divide by the input depth (which is also the output depth) to get the # coefficient. expected_coeff = _flops(self.dw_op) / (10.0) actual_coeff = bilinear_cost_utils.flop_coeff(self.dw_op) self.assertNearRelatively(expected_coeff, actual_coeff)