Module: Torch::Inspector

Included in:
Tensor
Defined in:
lib/torch/inspector.rb

Defined Under Namespace

Classes: Formatter

Constant Summary collapse

{
  precision: 4,
  threshold: 1000,
  edgeitems: 3,
  linewidth: 80,
  sci_mode: nil
}

Instance Method Summary collapse

Instance Method Details

#inspectObject



109
110
111
112
113
114
115
116
117
# File 'lib/torch/inspector.rb', line 109

def inspect
  Torch.no_grad do
    str_intern(self)
  end
rescue => e
  # prevent stack error
  puts e.backtrace.join("\n")
  "Error inspecting tensor: #{e.inspect}"
end