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

Function IsZero

tensorflow/cc/gradients/nn_grad.cc:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48REGISTER_GRADIENT_OP("Softmax", SoftmaxGrad);
49
50bool IsZero(const Scope& scope, const Output& grad) {
51 string op_type_name = grad.op().node()->type_string();
52 if (op_type_name == "ZerosLike" || op_type_name == "Zeros") {
53 return true;
54 }
55 // The Operation we were provided is not named something obvious so
56 // we need to actually look at its contents.
57 // The original python code did this by calling a utility function called
58 // tensor_util.constant_value.
59 // There is no C++ equivalent to tensor_util.constant_value so we do nothing
60 // for the moment.
61 return false;
62}
63
64// Multiply after broadcasting vec to match dimensions of mat.
65// Args:

Callers 1

Calls 2

nodeMethod · 0.45
opMethod · 0.45

Tested by

no test coverage detected