Shape function for a MatMul op.
(op)
| 102 | |
| 103 | |
| 104 | def matmul_shape(op): |
| 105 | """Shape function for a MatMul op.""" |
| 106 | a_shape = op.inputs[0].get_shape().with_rank(2) |
| 107 | transpose_a = op.get_attr("transpose_a") |
| 108 | b_shape = op.inputs[1].get_shape().with_rank(2) |
| 109 | transpose_b = op.get_attr("transpose_b") |
| 110 | output_rows = a_shape[1] if transpose_a else a_shape[0] |
| 111 | output_cols = b_shape[0] if transpose_b else b_shape[1] |
| 112 | inner_a = a_shape[0] if transpose_a else a_shape[1] |
| 113 | inner_b = b_shape[1] if transpose_b else b_shape[0] |
| 114 | inner_a.assert_is_compatible_with(inner_b) |
| 115 | return [tensor_shape.TensorShape([output_rows, output_cols])] |
| 116 | |
| 117 | |
| 118 | def get_conv_output_size(input_size, filter_size, strides, padding_type): |
nothing calls this directly
no test coverage detected