Computes matmul(x, weights) + biases. Args: x: a 2D tensor. Dimensions typically: batch, in_units weights: a 2D tensor. Dimensions typically: in_units, out_units biases: a 1D tensor. Dimensions: out_units name: A name for the operation (optional). If not specified "xw_pl
(x, weights, biases, name=None)
| 4204 | |
| 4205 | @tf_export(v1=["nn.xw_plus_b"]) |
| 4206 | def xw_plus_b(x, weights, biases, name=None): # pylint: disable=invalid-name |
| 4207 | """Computes matmul(x, weights) + biases. |
| 4208 | |
| 4209 | Args: |
| 4210 | x: a 2D tensor. Dimensions typically: batch, in_units |
| 4211 | weights: a 2D tensor. Dimensions typically: in_units, out_units |
| 4212 | biases: a 1D tensor. Dimensions: out_units |
| 4213 | name: A name for the operation (optional). If not specified |
| 4214 | "xw_plus_b" is used. |
| 4215 | |
| 4216 | Returns: |
| 4217 | A 2-D Tensor computing matmul(x, weights) + biases. |
| 4218 | Dimensions typically: batch, out_units. |
| 4219 | """ |
| 4220 | with ops.name_scope(name, "xw_plus_b", [x, weights, biases]) as name: |
| 4221 | x = ops.convert_to_tensor(x, name="x") |
| 4222 | weights = ops.convert_to_tensor(weights, name="weights") |
| 4223 | biases = ops.convert_to_tensor(biases, name="biases") |
| 4224 | mm = math_ops.matmul(x, weights) |
| 4225 | return bias_add(mm, biases, name=name) |
| 4226 | |
| 4227 | |
| 4228 | def xw_plus_b_v1(x, weights, biases, name=None): |
nothing calls this directly
no test coverage detected