import re


def node_is_weight(node):
  """ Judge if the node is weight.

  Args:
    node: A json node load from mxnet json file.

  Returns:
    True if the node is weight. False for input tensors and operators.
  """
  ret = False
  if node["op"] == "null" and ("attrs" in node.keys() or \
      re.search("_(weight|bias|var|mean|gamma|beta|label)", node["name"])):
    ret = True
  return ret