MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / xw_plus_b

Function xw_plus_b

tensorflow/python/ops/nn_ops.py:4206–4225  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

4204
4205@tf_export(v1=["nn.xw_plus_b"])
4206def 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
4228def xw_plus_b_v1(x, weights, biases, name=None):

Callers

nothing calls this directly

Calls 3

bias_addFunction · 0.70
name_scopeMethod · 0.45
matmulMethod · 0.45

Tested by

no test coverage detected