MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / __init__

Method __init__

tensorpack/callbacks/graph.py:179–195  ·  view source on GitHub ↗

Args: tensor_name (str): the name of the tensor. prefix (str): the filename prefix for saved images. Defaults to the Op name. map_func: map the value of the tensor to an image or list of images of shape [h, w] or [h, w, c]. If None, will

(self, tensor_name, prefix=None, map_func=None, scale=255)

Source from the content-addressed store, hash-verified

177 """
178
179 def __init__(self, tensor_name, prefix=None, map_func=None, scale=255):
180 """
181 Args:
182 tensor_name (str): the name of the tensor.
183 prefix (str): the filename prefix for saved images. Defaults to the Op name.
184 map_func: map the value of the tensor to an image or list of
185 images of shape [h, w] or [h, w, c]. If None, will use identity.
186 scale (float): a multiplier on pixel values, applied after map_func.
187 """
188 op_name, self.tensor_name = get_op_tensor_name(tensor_name)
189 self.func = map_func
190 if prefix is None:
191 self.prefix = op_name
192 else:
193 self.prefix = prefix
194 self.log_dir = logger.get_logger_dir()
195 self.scale = scale
196
197 def _before_train(self):
198 self._tensor = self.graph.get_tensor_by_name(self.tensor_name)

Callers

nothing calls this directly

Calls 1

get_op_tensor_nameFunction · 0.85

Tested by

no test coverage detected