def audio(self, name, tensor, sample_rate, max_outputs, family=None): """Write an audio summary. Args: name: A name for the generated node. Will also serve as a series name in TensorBoard. tensor: A 3-D `float32` `Tensor` of shape `[batch_size, frames, channels]` or a 2-D `float32` `Tensor` of shape `[batch_size, frames]`, or compatible value type. sample_rate: A Scalar `float32` `Tensor` indicating the sample rate of the signal in hertz. max_outputs: Max number of batch elements to generate audio for. family: Optional; if provided, used as the prefix of the summary tag name, which controls the tab name used for display on Tensorboard. """ with context.device(self._CPU_DEVICE): with summary_op_util.summary_scope( name, family, values=[tensor]) as (tag, scope): gen_summary_ops.write_audio_summary( self._resource, self._update_global_step_tensor(), tag, _maybe_cpu(tensor), sample_rate=_maybe_cpu(sample_rate), max_outputs=max_outputs, name=scope)
def audio(self, name, tensor, sample_rate, max_outputs, family=None): """Write an audio summary. Args: name: A name for the generated node. Will also serve as a series name in TensorBoard. tensor: A 3-D `float32` `Tensor` of shape `[batch_size, frames, channels]` or a 2-D `float32` `Tensor` of shape `[batch_size, frames]`, or compatible value type. sample_rate: A Scalar `float32` `Tensor` indicating the sample rate of the signal in hertz. max_outputs: Max number of batch elements to generate audio for. family: Optional; if provided, used as the prefix of the summary tag name, which controls the tab name used for display on Tensorboard. """ with context.device(self._CPU_DEVICE): with summary_op_util.summary_scope(name, family, values=[tensor]) as (tag, scope): gen_summary_ops.write_audio_summary( self._resource, self._update_global_step_tensor(), tag, _maybe_cpu(tensor), sample_rate=_maybe_cpu(sample_rate), max_outputs=max_outputs, name=scope)
def function(tag, scope): gen_summary_ops.write_audio_summary( context.context().summary_writer_resource, training_util.get_global_step(), tag, tensor, sample_rate=sample_rate, max_outputs=max_outputs, name=scope)
def record(): with summary_op_util.summary_scope(name, family, values=[tensor]) as (tag, scope): gen_summary_ops.write_audio_summary( context.context().summary_writer_resource, training_util.get_global_step(), tag, tensor, sample_rate=sample_rate, max_outputs=max_outputs, name=scope)
def record(): with summary_op_util.summary_scope( name, family, values=[tensor]) as (tag, scope): gen_summary_ops.write_audio_summary( context.context().summary_writer_resource, training_util.get_global_step(), tag, tensor, sample_rate=sample_rate, max_outputs=max_outputs, name=scope)
def function(tag, scope): # Note the identity to move the tensor to the CPU. return gen_summary_ops.write_audio_summary( context.context().summary_writer_resource, _choose_step(step), tag, array_ops.identity(tensor), sample_rate=sample_rate, max_outputs=max_outputs, name=scope)